地理codeR错误 [英] Geo Coder Error

查看:146
本文介绍了地理codeR错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的地理codeR类找到地址,但我得到一个IOException,使用信息的服务不可用,我怎么能解决这个问题。

I am using geo coder class to find the address, but I, get a IOException with message, of "Service Not Available", How I can solve this problem.

推荐答案

这是一个已知问题与模拟器。它工作正常,在实际设备上

This is a know issue with the Emulator. It works fine on an actual device

在2.2 API 8,你会收到以下堆栈跟踪

On 2.2 API 8 you'll receive the following stacktrace

java.io.IOException: Service not Available
at android.location.Geocoder.getFromLocation(Geocoder.java:117)

在这里看到更多的信息(和可能的解决方法)请参阅以下网址:

See here for more info (and a possible workaround) see the following URL :

HTTP://$c$c.google。 COM / p /安卓/问题/细节?ID = 8816

如果您在使用较低的API的地理codeR问题,您应检查堆栈跟踪。不时我有以下内容:

If you're having issues using the GeoCoder on lower APIs you should check the stacktrace. From time to time I'm having the following :

java.io.IOException: Unable to parse response from server
at android.location.Geocoder.getFromLocation(Geocoder.java:124) 

这可以从服务器端的问题,任何事情在谷歌或客户端(互联网连接)的问题。

This can be anything from a server-side issue at Google, or an issue on the client (internet connection).

如果地缘codeR返回一个空列表,你需要检查,如果你有一个适当的地理codeR可用的设备(模拟器或真正的手机)关于实施

If the GeoCoder returns an empty list, you need to check if you have a proper GeoCoder implementation available on the device (emulator or real phone).

这可以使用is present()方法的地理codeR对象上进行。

This can be done using the isPresent() method on the Geocoder object.

http://developer.android.com/reference/安卓/位置/地理位置coder.html

此外,在仿真器上运行时,请确保您的AVD形象是建立在谷歌的API。

Also, when running on an emulator, make sure your AVD image is setup with the Google APIs.

这篇关于地理codeR错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆