As of Android 8.0 you need to start a service in foreground mode to prevent the system from killing it. This results in a persistent notification. I went through the background location tracking tutorial here.
https://www.b4x.com/android/forum/threads/background-location-tracking.99873/
I can see that it uses both Service.StartForeground (for persistent notification) and StartServiceAt (in case the service needs to be started again). Just like in the example, I also need the location data only every 30 minutes or so. My question is, in this case, can I omit Service.StartForeground (thereby eliminating the need for persistent notification) and just use StartServiceAt as I don't need the location data all the time and only at the exact time the service is started.
https://www.b4x.com/android/forum/threads/background-location-tracking.99873/
I can see that it uses both Service.StartForeground (for persistent notification) and StartServiceAt (in case the service needs to be started again). Just like in the example, I also need the location data only every 30 minutes or so. My question is, in this case, can I omit Service.StartForeground (thereby eliminating the need for persistent notification) and just use StartServiceAt as I don't need the location data all the time and only at the exact time the service is started.