地理coder.getFromLocationName()抛出"服务不可用"除了在Android 4与谷歌地图V2抛出、不可用、地理、地图

2023-09-06 23:12:54 作者:我爹她女儿可萌了

方法地理coder.getFromLocationName()抛出异常服务不可用在Android 4.1,即使 GooglePlayServicesUtil.isGooglePlayServicesAvailable()返回成功地理coder.is present()返回。 是否有地理编码的新的谷歌地图V2 API中的任何官方的例子吗?

The method Geocoder.getFromLocationName() throws the exception Service not available on Android 4.1, even if GooglePlayServicesUtil.isGooglePlayServicesAvailable() returns SUCCESS and Geocoder.isPresent() returns true. Is there any official example for geocoding in the new Google Maps v2 API?

推荐答案

地理codeR 是不相关的谷歌地图Android的API V2。

Geocoder is not related to Google Maps Android API v2.

您可能需要使用谷歌地理编码API ,而不是直接地理codeR ,它给你有限的数据量,并可能会影响设备或Android版本的具体问题。

You may want to use Google Geocoding API directly instead of Geocoder, which gives you limited amount of data and might be affected by device or Android version specific problems.