C carloz Member Licensed User Longtime User Jan 28, 2017 #1 hello Forum, I have a app with multiple background services to handle location tracking and alarms. So far the app was working perfectly well and all services were starting properly when scheduled . On 5.1 and above none of the services are starting as scheduled, also tried to make the services sticky, but as soon as the app is swiped from the recent list or ExitApplication is used, the services are stopped and do not restart... I see other apps like facebook,whatsapp,truecaller and many others having background services and they do not encounter the same issues that i am facing.. Can someone point me in the right direction? what am i missing here? regards carloz
hello Forum, I have a app with multiple background services to handle location tracking and alarms. So far the app was working perfectly well and all services were starting properly when scheduled . On 5.1 and above none of the services are starting as scheduled, also tried to make the services sticky, but as soon as the app is swiped from the recent list or ExitApplication is used, the services are stopped and do not restart... I see other apps like facebook,whatsapp,truecaller and many others having background services and they do not encounter the same issues that i am facing.. Can someone point me in the right direction? what am i missing here? regards carloz
C carloz Member Licensed User Longtime User Jan 29, 2017 #2 hello, Has anyone faced this issue? i tried to restart the service from the starter service "Service_TaskRemoved" .. but no luck regards carloz Upvote 0
hello, Has anyone faced this issue? i tried to restart the service from the starter service "Service_TaskRemoved" .. but no luck regards carloz
Erel B4X founder Staff member Licensed User Longtime User Jan 29, 2017 #3 You shouldn't call ExitApplication. You should use a foreground service if you want to keep the service running in the background. Whatsapp is not running in the background all the time. It uses push notifications. Upvote 0
You shouldn't call ExitApplication. You should use a foreground service if you want to keep the service running in the background. Whatsapp is not running in the background all the time. It uses push notifications.
C carloz Member Licensed User Longtime User Jan 29, 2017 #4 hello erel good morning!! I did remove the exitapplication .. also tried to start the service as a foreground Code: Copy sNotif.Initialize sNotif.Icon = "icon" sNotif.SetInfo("xxxx","yyyy",Main) sNotif.Sound = False sNotif.Light = False sNotif.Vibrate = False sNotif.Notify(1) Service.StartForeground(1,sNotif) but same results as soon as the user swipes from the recent task list .. the service is stopped and the foreground icon is cleared too ... am i missing something in the manifest? im on api 23 thnx for replying Upvote 0
hello erel good morning!! I did remove the exitapplication .. also tried to start the service as a foreground Code: Copy sNotif.Initialize sNotif.Icon = "icon" sNotif.SetInfo("xxxx","yyyy",Main) sNotif.Sound = False sNotif.Light = False sNotif.Vibrate = False sNotif.Notify(1) Service.StartForeground(1,sNotif) but same results as soon as the user swipes from the recent task list .. the service is stopped and the foreground icon is cleared too ... am i missing something in the manifest? im on api 23 thnx for replying
Erel B4X founder Staff member Licensed User Longtime User Jan 29, 2017 #5 Please try this: - Start B4A-Bridge - Make sure that the A icon shows in the top bar. - Swipe B4A-Bridge from the recent task list. Does the icon disappear? It is kept here. Upvote 0
Please try this: - Start B4A-Bridge - Make sure that the A icon shows in the top bar. - Swipe B4A-Bridge from the recent task list. Does the icon disappear? It is kept here.
C carloz Member Licensed User Longtime User Jan 29, 2017 #6 hi ..tried it... sorry but the b4a bridge "A" icon disappears too Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Jan 29, 2017 #7 This is not the "correct" behavior. I don't think that you can do anything about it. Worth looking for power related settings. It seems like the manufacturer implemented the swipe feature as it it is a "force stop". This means that the process is always killed and cannot be restarted unless the user explicitly starts the app. Upvote 0
This is not the "correct" behavior. I don't think that you can do anything about it. Worth looking for power related settings. It seems like the manufacturer implemented the swipe feature as it it is a "force stop". This means that the process is always killed and cannot be restarted unless the user explicitly starts the app.
C carloz Member Licensed User Longtime User Jan 29, 2017 #8 i agree..thats what has me stumped...funnily when i swipe the facebook app from the recent list ..its service is not killed...how could they be managing that? Upvote 0
i agree..thats what has me stumped...funnily when i swipe the facebook app from the recent list ..its service is not killed...how could they be managing that?
Erel B4X founder Staff member Licensed User Longtime User Jan 29, 2017 #9 Try to whiltelist B4A-Bridge and see whether it makes any difference: https://www.cnet.com/how-to/stop-specific-apps-from-using-doze-on-android-6-0-marshmallow/ It is also possible that facebook app is treated specially. Upvote 0
Try to whiltelist B4A-Bridge and see whether it makes any difference: https://www.cnet.com/how-to/stop-specific-apps-from-using-doze-on-android-6-0-marshmallow/ It is also possible that facebook app is treated specially.
KMatle Expert Licensed User Longtime User Jan 29, 2017 #10 Erel said: It is also possible that facebook app is treated specially. Click to expand... Huawei calls it "protected apps". If you have one, set your app to "protected". FB & WhatsApp get these status automatically (due to definition). 3 months ago Huawei brought an extra system update because they had WhatsApp not in their whitelist (which caused a lot of problems because users wondered why on their "new highend phone" WhatsApp "did not work/no FCM messages arrived, etc.". Even my Goggle calendar widget did not update due to this. Took me a lot of time testing and getting mad because my first FCM app did not receive any messages when the screen was off Upvote 0
Erel said: It is also possible that facebook app is treated specially. Click to expand... Huawei calls it "protected apps". If you have one, set your app to "protected". FB & WhatsApp get these status automatically (due to definition). 3 months ago Huawei brought an extra system update because they had WhatsApp not in their whitelist (which caused a lot of problems because users wondered why on their "new highend phone" WhatsApp "did not work/no FCM messages arrived, etc.". Even my Goggle calendar widget did not update due to this. Took me a lot of time testing and getting mad because my first FCM app did not receive any messages when the screen was off
C carloz Member Licensed User Longtime User Jan 30, 2017 #11 thnx for replying guys...ill try whitelisting the app Upvote 0