Reputation: 133
Maybe I haven't been googling the right thing, but I am trying to figure out how to track the time a user spends at a particular location. I did some research, and I found that I could use the Geofencing API to define a Geofence location and then fire off an IntentService when the user's current location is within the Geofence. How do I begin to track the time spent at this location? Any insights/comments/tutorials/sample code would be most appreciated!
Upvotes: 1
Views: 534
Reputation: 498
I don't have much idea here, but I think there is a LocationListener that listens for updates on change in device's location.
You can compute time between consequent location updates to find the time spent at the most recent location.
For details, you can go through LocationListener/LocationManager documentation on developer.android.com.
Upvotes: 1