简体   繁体   中英

Android: How can i find user's city via gps?

I develop a new application in android studio. I want to find user's city. I tried with Geocoder but some times it returns null. Is there any way that i can find user's city? I already know his latitude and longitude

If you know the lat and long, you can do this.

https://developers.google.com/maps/documentation/geocoding/start?csw=1#ReverseGeocoding

You will use this API like so... you would have have to parse out the JSON http://maps.googleapis.com/maps/api/geocode/json?latlng=LAT,LONG&key=ENTER_API_KEY

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