Roberto P. Well-Known Member Licensed User Longtime User Dec 20, 2018 #1 I still have problems with the operation of the services, which do not always start at the established intervals. I set the start every 5 minutes Code: StartServiceAt("", DateTime.Now + 5 * DateTime.TicksPerMinute, True) these messages are displayed occasionally: No partial wakelock. ** Service (starter) Destroy (ignored)** ** Receiver (starter) OnReceive ** The Starter service should never be started from a receiver. *** Service (starter) Create *** Click to expand... someone can help me understand what it can be thank in advance
I still have problems with the operation of the services, which do not always start at the established intervals. I set the start every 5 minutes Code: StartServiceAt("", DateTime.Now + 5 * DateTime.TicksPerMinute, True) these messages are displayed occasionally: No partial wakelock. ** Service (starter) Destroy (ignored)** ** Receiver (starter) OnReceive ** The Starter service should never be started from a receiver. *** Service (starter) Create *** Click to expand... someone can help me understand what it can be thank in advance
DonManfred Expert Licensed User Longtime User Dec 20, 2018 #2 Roberto P. said: I set the start every 5 minutes Click to expand... Android will not allow you to run a service in so such short intervals! Set it to 30 minutes or more. Additionally you need to inform about services in android 8 and above. https://www.b4x.com/android/forum/threads/automatic-foreground-mode.90546/#content Upvote 0
Roberto P. said: I set the start every 5 minutes Click to expand... Android will not allow you to run a service in so such short intervals! Set it to 30 minutes or more. Additionally you need to inform about services in android 8 and above. https://www.b4x.com/android/forum/threads/automatic-foreground-mode.90546/#content
Roberto P. Well-Known Member Licensed User Longtime User Dec 20, 2018 #3 thank Manfred I read the post about services in Android 8, and At this point I ask for help to correctly create a service that remains always active, which starts every 5 minutes or less, which works from version 6 of Android up to 8.01. thank in advance Upvote 0
thank Manfred I read the post about services in Android 8, and At this point I ask for help to correctly create a service that remains always active, which starts every 5 minutes or less, which works from version 6 of Android up to 8.01. thank in advance
Erel B4X founder Staff member Licensed User Longtime User Dec 21, 2018 #4 You shouldn't use StartServiceAt with the starter service. Use a different service. Always running service that works on all versions of Android: Background location tracking Upvote 0
You shouldn't use StartServiceAt with the starter service. Use a different service. Always running service that works on all versions of Android: Background location tracking
Roberto P. Well-Known Member Licensed User Longtime User Dec 21, 2018 #5 Erel said: You shouldn't use StartServiceAt with the starter service. Use a different service. Always running service that works on all versions of Android: Background location tracking Click to expand... Hi Erel, this is the implementation: - I've Starter Service - I've Sync Service - StartService run Sync service: Code: Sub Service_Start (StartingIntent As Intent) .... StartService(SSync) - SyncService have the startAt timer Code: Sub Service_Start (StartingIntent As Intent) ... StartServiceAt("", DateTime.Now + 5 * DateTime.TicksPerMinute, True) ' this is try for not terminate the service Service.AutomaticForegroundMode = Service.AUTOMATIC_FOREGROUND_ALWAYS there is somethings wrong? thank Upvote 0
Erel said: You shouldn't use StartServiceAt with the starter service. Use a different service. Always running service that works on all versions of Android: Background location tracking Click to expand... Hi Erel, this is the implementation: - I've Starter Service - I've Sync Service - StartService run Sync service: Code: Sub Service_Start (StartingIntent As Intent) .... StartService(SSync) - SyncService have the startAt timer Code: Sub Service_Start (StartingIntent As Intent) ... StartServiceAt("", DateTime.Now + 5 * DateTime.TicksPerMinute, True) ' this is try for not terminate the service Service.AutomaticForegroundMode = Service.AUTOMATIC_FOREGROUND_ALWAYS there is somethings wrong? thank
Erel B4X founder Staff member Licensed User Longtime User Dec 23, 2018 #6 Based on the warning message you are starting the starter service from a receiver. This is a mistake. It doesn't happen in the code you posted. Roberto P. said: there is somethings wrong? Click to expand... Yes, newer versions of Android will not let you schedule the app to start every 5 minutes. Upvote 0
Based on the warning message you are starting the starter service from a receiver. This is a mistake. It doesn't happen in the code you posted. Roberto P. said: there is somethings wrong? Click to expand... Yes, newer versions of Android will not let you schedule the app to start every 5 minutes.
Roberto P. Well-Known Member Licensed User Longtime User Dec 23, 2018 #7 Erel said: Based on the warning message you are starting the starter service from a receiver. This is a mistake. It doesn't happen in the code you posted. Click to expand... so what can be caused by an error? Erel said: Yes, newer versions of Android will not let you schedule the app to start every 5 minutes. Click to expand... what is the minimum time? Upvote 0
Erel said: Based on the warning message you are starting the starter service from a receiver. This is a mistake. It doesn't happen in the code you posted. Click to expand... so what can be caused by an error? Erel said: Yes, newer versions of Android will not let you schedule the app to start every 5 minutes. Click to expand... what is the minimum time?
DonManfred Expert Licensed User Longtime User Dec 23, 2018 #8 Roberto P. said: what is the minimum time? Click to expand... 30 minutes or more i think You can use a always running service as an alternative. No need to restart anything. https://www.b4x.com/android/forum/threads/background-location-tracking.99873/#content Last edited: Dec 23, 2018 Upvote 0
Roberto P. said: what is the minimum time? Click to expand... 30 minutes or more i think You can use a always running service as an alternative. No need to restart anything. https://www.b4x.com/android/forum/threads/background-location-tracking.99873/#content