0

I'm developing a Android gps-data-logger, which saves the gps position in a database. I've the following problem:

If there is too much traffic in background, if there are too much app open and the gps-data-logger don't find the gps position shortly, the app is closed by system and if the user opens the app again, the app restarts.

How can I avoid the closing of my app in background?

Cœur
  • 37,241
  • 25
  • 195
  • 267

1 Answers1

0

If you want to try a service in the background, you can see this example: Background Service in Android. Or, there are many examples of services for free on the web, including google's own docs: Android Services. Other sample code from a StackOverflow question can be found here.

Also, try this project that logs users gps: gpslogger project source code

Community
  • 1
  • 1
MiStr
  • 1,193
  • 10
  • 17