Android Question [B4XPages] So, if the app is not paused ...

cheveguerra

Member
Licensed User
Longtime User
Good morning everybody,

I was reading that the activities with B4Xpages are not paused, even when they are in the background (https://www.b4x.com/android/forum/t...kground-tasks-and-services.121372/post-758759), so if this is true, then, if I have an app that periodically gets information from a server and display it in a list or label or whatever, then in a "non-b4xpages" the app would not update when in the background (activity paused), even if the update is done in Starter, the display of the information would be done in an activity, and that would be paused and obviously not updated until resumed ... ... ... but if the same is done on a B4XPages app, if a service (starter) gets some info from a server and then sends it to a label in a B4XPage, would it be updated/modified even when in the background? . . an immediately available when the app is reopened/resumed??? . .. in a non-b4xpage the update would simply not be done unless "cached" to a keymap and sent to the activity when resumed.

Activity app.
 

Attachments

  • 1647884816736.png
    1647884816736.png
    192.9 KB · Views: 110

cheveguerra

Member
Licensed User
Longtime User
Sorry about the image attached, it got copied by mistake and I cannot edit the post to delete it!

To clarify my original post (sometimes not even I understand what I am saying or writing)

In an activity app:
1.- The app is in the background (paused).
2.- Get some info from a server in Starter.
3.- Put it in a keymap.
4.- if the app is resumed, then read the keymap and put the info in the activity label.

In a B4XPages app:
1.- The app is the background (Not paused).
2.- Get some info from a server in Starter.
3.- Put the info in the activity label.
4.- When the app is reopened/resumed the info *should* be in the label already.

Is the above true? .. did I misunderstood?

Best regards!
 
Upvote 0

josejad

Expert
Licensed User
Longtime User
Is the above true? .. did I misunderstood?
It's true the app will be not paused when goes to background, but that doesn't mean it can't be killed by the OS, and you don't know if it will happen in a few seconds or in several minutes.
If you need to do something in the background, you still need a service.
 
Last edited:
Upvote 1

teddybear

Well-Known Member
Licensed User
Sorry about the image attached, it got copied by mistake and I cannot edit the post to delete it!

To clarify my original post (sometimes not even I understand what I am saying or writing)

In an activity app:
1.- The app is in the background (paused).
2.- Get some info from a server in Starter.
3.- Put it in a keymap.
4.- if the app is resumed, then read the keymap and put the info in the activity label.

In a B4XPages app:
1.- The app is the background (Not paused).
2.- Get some info from a server in Starter.
3.- Put the info in the activity label.
4.- When the app is reopened/resumed the info *should* be in the label already.

Is the above true? .. did I misunderstood?

Best regards!
Yes it is true, you may do anything in b4xpage_appear event same as resume
 
Upvote 0
Top