Is it possible to get location updates in android app after force stopping the app. In IOS it is possible to get the location update if we force stop the app, in similar manner is there any service which can provide location updates to killed app in android.
-
1No way to get location updates once the app is force stopped – Umang Jan 17 '18 at 15:07
2 Answers
No, this isn't possible because the app's process has been killed and the registered locations listener has been removed. The system doesn't know who it should deliver the Location updates too. It the user force stops and app, by all means that means the app should stop what ever it's doing. But if the app is killed because of low memory pressures, then this is where using a STICKY service would come in handy. Simply register for location udpates inside of your Location Service and then inside of onStartCommmand return the START_STICKY constant to indicate to the system that if the service is killed (not force stopped), then the system should restart the service when memory pressure drops.

- 1,140
- 1
- 9
- 19
Yes, app could restart itself if you had some Geofence registered using BroadcastReceiver. Whenever device enter/leaves the Geofence app would receive the callback via BroadcastReceiver and in this callback you can reschedule location update listener.
But without Geofences location updates are not given to forced closed app.
Here you can know the basics about how to monitor geofences.

- 4,411
- 6
- 27
- 31