0

我在 android studio 中开发了一个新的应用程序。我想找到用户的城市。我尝试使用 Geocoder,但有时它返回 null。有什么办法可以找到用户所在的城市?我已经知道他的经纬度了

4

1 回答 1

1

如果你知道纬度和经度,你可以这样做。

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

您将像这样使用此 API...您必须解析 JSON http://maps.googleapis.com/maps/api/geocode/json?latlng=LAT,LONG&key=ENTER_API_KEY

于 2019-01-07T21:19:55.897 回答