Skip to content Skip to sidebar Skip to footer

How To Keep An App Running Continually With Gps On?

I have an application that is required to log the user's location every couple of seconds, the entire time it is on. On does not mean in the foreground,or that even the Android's s

Solution 1:

You should use Service, you can choose that the service wil keep running even after your app was closed.

YET if the device is low on resources it might close your service. you can use FOREGROUND service if you want to minimize the chance android will close your service. inside the service use LocationManager / FusedLocation to get the location every X time. you set it up with LocationListener so everytime it set onLocationChanged you upload to firebase.

Useful links:

Make your app loaction aware

Services

Post a Comment for "How To Keep An App Running Continually With Gps On?"