Use firebase job dispatcher or PowerManager wakelock

0

I have a mobile application in which I get the location every 5 minutes, at the moment I am using PowerManager wakelock and it works well when I lock the computer, but when I close the application it stops working, what I need is for the application to continue taking the location in backgroud, can someone recommend me if I keep working with PowerManager wakelock or do I need to change?

    
asked by Dany07 25.09.2018 в 19:16
source

1 answer

0

Well, I use firebase to get the positions in real time and they work, every time I open the app it gives me the current position and the last position of when the app closes, that is, I close the app and that is the last position and when I open it shows me the last one and where it is in real time that I do with firebase, if what you want is to continue running after closing the app what you should do is make a service and then if you want to add a notification that the position that person has changed so that the user enters through the notification to the app, the same can also be done with firebase I do all this and the position is every 1sec

I hope I have helped you, and the next one is more explicit or put some code to see what you mean clearly, have a good day or night xD

    
answered by 26.09.2018 в 18:02