Search code examples
androidgoogle-mapslocationtracking

Android - Tracking location device realtime using Google Map


I'm trying develop application using Google Map API. The application will display position other device in Map if user online using my application. For Example tracking people nearby.

What is I have to send Latitude and Longitude of each people device to my database server and in all device automatically update Marker in Map every time?
Or in Google Map API can handle that problem?


Solution

  • You need to implement location listener like this: http://blog.doityourselfandroid.com/2010/12/25/understanding-locationlistener-android/

    And in onLocationChanged method you need to send new user location to server. Then server must send gcm to all devices. Help this: https://developers.google.com/cloud-messaging/android/client