B Bob Spielen Active Member Licensed User Longtime User Dec 17, 2019 #1 Im using a WakeUp service with the function : Code: Copy If P.SdkVersion > 18 Then StartServiceAtExact(despertador, (DateTime.Now) , True) Else StartServiceAt(despertador,(DateTime.Now),True) On many phones, it works perfectly. On a Samsung Galaxy S5, does not work! Does anyone have an idea of what could be happening! In advance I thank you for the help.
Im using a WakeUp service with the function : Code: Copy If P.SdkVersion > 18 Then StartServiceAtExact(despertador, (DateTime.Now) , True) Else StartServiceAt(despertador,(DateTime.Now),True) On many phones, it works perfectly. On a Samsung Galaxy S5, does not work! Does anyone have an idea of what could be happening! In advance I thank you for the help.
Jorge M A Well-Known Member Licensed User Longtime User Dec 18, 2019 #2 You can check this[^] Or this[^] Or search the forum: https://www.b4x.com/android/forum/pages/results/?query=samsung+doze+ Upvote 0
You can check this[^] Or this[^] Or search the forum: https://www.b4x.com/android/forum/pages/results/?query=samsung+doze+
B Bob Spielen Active Member Licensed User Longtime User Dec 18, 2019 #3 Jorge M A said: You can check this[^] Or this[^] Or search the forum: https://www.b4x.com/android/forum/pages/results/?query=samsung+doze+ Click to expand... Jorge! Muito obrigado!!!! Thanks a lot! Will check... Upvote 0
Jorge M A said: You can check this[^] Or this[^] Or search the forum: https://www.b4x.com/android/forum/pages/results/?query=samsung+doze+ Click to expand... Jorge! Muito obrigado!!!! Thanks a lot! Will check...
Erel B4X founder Staff member Licensed User Longtime User Dec 18, 2019 #4 You can use StartServiceAtExact on all versions of Android. Upvote 0
B Bob Spielen Active Member Licensed User Longtime User Dec 19, 2019 #5 Erel said: You can use StartServiceAtExact on all versions of Android. Click to expand... Mr. Erel, first ..thanks a lot for the reply. Im not sure if I understood when should I start a service in the foreground mode.... In this case of a long term (4days) wake up service should I use Service.AUTOMATIC_FOREGROUND_WHEN_NEEDED , Service.AUTOMATIC_FOREGROUND_NEVER (with Pw.PartialLock) or Service.AUTOMATIC_FOREGROUND_ALWAYS (so OS will not kill and then using Service.StopAutomaticForeground by the end of the service...) ? In advance thank you very much! Upvote 0
Erel said: You can use StartServiceAtExact on all versions of Android. Click to expand... Mr. Erel, first ..thanks a lot for the reply. Im not sure if I understood when should I start a service in the foreground mode.... In this case of a long term (4days) wake up service should I use Service.AUTOMATIC_FOREGROUND_WHEN_NEEDED , Service.AUTOMATIC_FOREGROUND_NEVER (with Pw.PartialLock) or Service.AUTOMATIC_FOREGROUND_ALWAYS (so OS will not kill and then using Service.StopAutomaticForeground by the end of the service...) ? In advance thank you very much!
Erel B4X founder Staff member Licensed User Longtime User Dec 22, 2019 #6 Your last question is not really related to this thread. It depends on your app requirements. If the task will run for a few seconds then your best option is to use the default (WHEN_NEEDED). Upvote 0
Your last question is not really related to this thread. It depends on your app requirements. If the task will run for a few seconds then your best option is to use the default (WHEN_NEEDED).