Prevent the service from closing

1

Hello, I have an android application that tracks gps signal, it works normal but every time it gets in the background it closes itself. I already researched the subject and saw that the android controls the closure of applications in the background. Is there a function that prevents this and keeps it always open?

    
asked by anonymous 12.03.2015 / 23:22

1 answer

2

Use the Service class for Android, it's perfect for apps that are running in the background doing some task from time to time. You can use the service class in conjunction with the AlarmManager or TimerTask class. Your service running in the background will only be terminated by the Operating System in extreme cases of need for resource release, and even if your service stops running, when you can Android OS restarts your Service.

    
14.03.2015 / 01:04