ankit
ankit

Reputation: 125

Google API GPS location Android available to all activities

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!

Upvotes: 1

Views: 149

Answers (1)

redAllocator
redAllocator

Reputation: 735

It is a duplicate question.

There are many solutions.

I recommend to you read following question.

Example: Communication between Activity and Service using Messaging

Upvotes: 1

Related Questions