I am able to get the user location by using Google API and Location services. That location is then saved to an online database. However, how would I go about making the location update every X amount of time (lets say 10 minutes). Also, the Google API and location services is linked specific activity. How would I make the location services available to all activities, meaning that once the user is logged in, no matter what activity the user is in, the location would be updated and saved to my database? Finally, if the phone is in sleep mode or the app is running in the background, would the location still be updated? Thanks, any suggestions or pointers are appreciated!
Asked
Active
Viewed 144 times
1
-
take a look at this answer http://stackoverflow.com/a/28535885/3998402 – humazed Mar 26 '17 at 00:12
1 Answers
1
It is a duplicate question.
There are many solutions.
I recommend to you read following question.
Example: Communication between Activity and Service using Messaging

Community
- 1
- 1

redAllocator
- 725
- 6
- 12