Hi all,
I developed a (simple) service that process (put null) thousands of items within the @Erel KVS Cloud (https://goo.gl/doKFpg).
PROBLEM
The user got the "App does not respond - Wait or Close" message.
Note that probably this problem is related to my custom APIs implementation and not to the KVS Cloud APIs.
WISH
I wish that this service run always (background mode) to check the older items (ex. older than x days) and delete them without block the main thread.
The service is configured in this way:
STARTER
SERVICE
Is the a way to configure the service to avoid the main thread block ?
Thanks in advance for your help
I developed a (simple) service that process (put null) thousands of items within the @Erel KVS Cloud (https://goo.gl/doKFpg).
PROBLEM
The user got the "App does not respond - Wait or Close" message.
Note that probably this problem is related to my custom APIs implementation and not to the KVS Cloud APIs.
WISH
I wish that this service run always (background mode) to check the older items (ex. older than x days) and delete them without block the main thread.
The service is configured in this way:
STARTER
B4X:
Sub Service_Start (StartingIntent As Intent)
StartService (srvDeleteOlderItems)
End Sub
SERVICE
B4X:
Sub Service_Create
n.Initialize
n.Icon = "icon"
n.Sound = False
n.AutoCancel = False
n.OnGoingEvent = True
n.SetInfo("", "", Main)
Service.StartForeground(1, n)
End Sub
Sub Service_Start (StartingIntent As Intent)
StartServiceAt("", DateTime.Now + 21600 * DateTime.TicksPerSecond, True) 'schedule the next task to run in 21600 (6 ore) seconds.
'Sub that loop over the thousands of items and put the null
'Note that the following sub use custom APIs (to implement my app logic) developed on top of the KVS Cloud APIs
DeleteOlderItems (7)
End Sub
Is the a way to configure the service to avoid the main thread block ?
Thanks in advance for your help
Last edited: