简体   繁体   中英

Tracking location in android with google maps

I want to develop an android app where i want to locate a person nearest to me (this member is registered in my app). I'm unable to proceed should i track the person with the help of mobile number or else is there any other way. Can anyone provide resources for this module

You can get a user current location and save it on your server . you can get location when user location change in latitute and longitude and save it on your server and in other device when you want to get user location you can get it on your server just read the user lati and longi and convert it them in location. and you can get user location in this ways.

Implement LocationListener interface in your Activity class and Implement onLocationChange(Location location) function, you will get users location on device, while sending location to your server capture mac id/imei of device and send along with it. Also register LocationListener with the location manager service using the requestLocationUpdates(String provider, long minTime, float minDistance, LocationListener listener) method. With this you can identify which device has send you the location. Also while registering devices you have to save users mac id/imei to identify user. I would suggest to use mac id as now a days there are many dual sim devices and if user changes sim slot then imei no might differ.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM