location-samples
location-samples copied to clipboard
Please modify code make this sample working even the app is killed by using service
Hello @dturner ,
I am using this sample and it works very well when the app is in foreground or in background but when I kill it from recents then no geofence is triggering.
Please make use of service for setting geofences in that to make this app working even when the app is killed.
If you have no time then allow my pull request so I can modify the code myself.
Thanks
@umarataTribyss That sound great, But can you please give me a bit idea that how geo fencing work as app get killed? Is it work on android oreo? Did you use foreground service to update geo fencing result?
For pre Oreo device we can use a Sticky Service which runs in background even the app is killed,
And yes for Oreo we need to implement Foreground service.
I actually used Foreground Service in one of my app and it works well even the app is killed in Oreo and later devices.
@umarataTribyss: I've also implemented a Foreground Service (with notification) and the solution works fine. But not when using Android Auto. Does your solution works during Android Auto is running?
@umarataTribyss could you provide a snippet of how you implemented the foreground service? I've been trying to get this to work but no success.
@umarataTribyss it will be VERY helpful if you share your code!
Geofencing is not working for me when app is killed. Working fine when app is in background. I am using broadcast receiver and JonIntentService together. Please suggest.