Question

Is there any way to upload the device location data to the cloud whenever a "push notification (think is gcm in Android)" arrives to the device? The user shouldn't have to press any buttons or do anything. I'm thinking about GCM because I need the app to run on the background (it doesn't matter if it needs some extra battery power).

If I can't upload the device location data on 'remote' demand via GCM and without any user interaction, then I would like to recieve ideas about how to reach my goal, for example, passive location tracking and something else. Any help would be appreciated.

Était-ce utile?

La solution

Yes you can do that. You will need to write a Service, you can start it on boot. You can use "Google Maps for Android API" to request one time location data using LocationClient.getLastLocation() whenever you receive GCM message. And once you have the Lcoation, you can send Lat/Lng Coordinates back into your server.

You can also do reverse geocoding, geofencing and activity recognition with the API. Please be careful with users location data.

Here's where you can start:

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top