tags:

views:

71

answers:

2

Android: i am using gps check box in my application, which user check this we use gps location of the user.

Now i have to make change if user check this checkbox we use gps location and if user remain this box checked then we have to detect user location every after 10 mins and if location is different we have to prompt user that location is change and if user want to use new location.

any idea how appy listner which get fire every after 10 min and get stop after detecting location ? any good idea to implement it just want you guys idea.

A: 

You can try implementing a service that runs on the background which can make a call once in every 10 mins and update the application about its changes

Rahul
yes thats good, i was thinking same.
Faisal khan
However if you feel you can update the user only if the location changes on the device you can use LocationListener interface
Rahul
how can i have service started from one activity and accessible in all activities ?
Faisal khan
In that case you need to send a broadcast from your service and enable your application to receive that broadcast
Rahul