Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Geolocation tracking and Google Cloud Messaging working together

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.

like image 877
amarruffo Avatar asked Nov 28 '25 17:11

amarruffo


1 Answers

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:

  • Google Maps for Android API
  • Making Location Aware App
  • Android Services
like image 155
Milan Avatar answered Dec 01 '25 06:12

Milan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!