Android Hello Map 查看模拟器上的问题

发布于 2024-08-15 09:29:46 字数 3205 浏览 3 评论 0原文

我正在尝试在 Android 模拟器上运行 Android Hello Map View 教程应用程序。将显示 Google 地图视图,但图块为空白。

根据以下错误(取自 LogCat)判断,该应用程序无法连接到互联网。模拟器上的 Web 浏览器可以正常连接。我还仔细检查了 API 密钥。

我在 Windows XP SP3 上使用来自 Eclipse Galileo 的 1.5 Google API SDK,位于公司防火墙后面。

我尝试了两种方法来添加代理信息:

  1. Add -http-proxy http://www .foo.co.uk:80 到调试配置中目标页面中的其他模拟器命令行选项。

  2. 删除1.中的设置并在首页>添加代理信息菜单>设置>无线控制>移动网络>接入点名称。

似乎都没有帮助。

还有其他想法吗?我应该在应用程序中添加代理信息吗?如果是这样,怎么办?

Sam Dutton


修正案:互联网权限已添加到清单应用程序元素中:

<uses-permission android:name="android.permission.INTERNET" />

12-23 16:43:31.624: INFO/System.out(717): waiting for debugger to settle...
12-23 16:43:31.828: INFO/System.out(717): debugger has settled (1480)
12-23 16:43:32.299: ERROR/ActivityThread(717): Failed to find provider info for com.google.settings
12-23 16:43:33.738: INFO/MapActivity(717): Handling network change notification:CONNECTED
12-23 16:43:33.738: ERROR/MapActivity(717): Couldn't get connection factory client
12-23 16:43:34.879: DEBUG/dalvikvm(717): GC freed 4012 objects / 232976 bytes in 97ms
12-23 16:43:37.818: INFO/ActivityManager(565): Displayed activity com.bbc.HelloMapView/.HelloMapView: 8939 ms
12-23 16:43:38.408: DEBUG/dalvikvm(717): GC freed 8198 objects / 604808 bytes in 90ms
12-23 16:43:38.888: INFO/InetAddress(717): Unknown host www.google.com, throwing UnknownHostException
12-23 16:43:40.488: INFO/InetAddress(717): Unknown host www.google.com, throwing UnknownHostException
12-23 16:43:42.097: INFO/InetAddress(717): Unknown host www.google.com, throwing UnknownHostException
12-23 16:43:43.307: DEBUG/dalvikvm(612): GC freed 4040 objects / 229536 bytes in 123ms
12-23 16:43:43.789: INFO/InetAddress(717): Unknown host www.google.com, throwing UnknownHostException
12-23 16:43:45.387: INFO/InetAddress(717): Unknown host www.google.com, throwing UnknownHostException
12-23 16:43:46.978: INFO/InetAddress(717): Unknown host www.google.com, throwing UnknownHostException
12-23 16:43:48.428: DEBUG/dalvikvm(656): GC freed 2771 objects / 170824 bytes in 234ms
12-23 16:43:48.708: INFO/InetAddress(717): Unknown host www.google.com, throwing UnknownHostException
12-23 16:43:50.298: INFO/InetAddress(717): Unknown host www.google.com, throwing UnknownHostException
12-23 16:43:51.898: INFO/InetAddress(717): Unknown host www.google.com, throwing UnknownHostException
12-23 16:43:53.277: DEBUG/dalvikvm(717): GC freed 5333 objects / 338584 bytes in 140ms
12-23 16:43:53.408: INFO/InetAddress(717): Unknown host www.google.com, throwing UnknownHostException
12-23 16:43:53.447: DEBUG/dalvikvm(636): GC freed 2913 objects / 165264 bytes in 244ms
12-23 16:43:56.527: INFO/InetAddress(717): Unknown host www.google.com, throwing UnknownHostException
12-23 16:43:58.329: DEBUG/dalvikvm(610): GC freed 3249 objects / 193992 bytes in 122ms
12-23 16:43:59.169: INFO/InetAddress(717): Unknown host www.google.com, throwing UnknownHostException
12-23 16:44:02.518: INFO/InetAddress(717): Unknown host www.google.com, throwing UnknownHostException

I'm trying to run the Android Hello Map View tutorial app on the Android emulator. The Google Map view displays, but the tiles are blank.

Judging by the errors below (taken from LogCat) the app is unable to connect to the internet. The web browser on the emulator connects without problems. I've also double-checked the API key.

I'm using the 1.5 Google APIs SDK, from Eclipse Galileo, on Windows XP SP3, behind a corporate firewall.

I've tried two methods to add proxy information:

  1. Add -http-proxy http://www.foo.co.uk:80 to Additional Emulator Command Line Options in the Target Page in Debug Configurations.

  2. Remove settings in 1. and add proxy information at Home > Menu > Settings > Wireless Controls > Mobile Networks > Access Point Names.

Neither seems to help.

Any other ideas? Should I be adding proxy information within the app? If so, how?

Sam Dutton


AMENDMENT: internet permission has been added to the manifest application element:

<uses-permission android:name="android.permission.INTERNET" />

12-23 16:43:31.624: INFO/System.out(717): waiting for debugger to settle...
12-23 16:43:31.828: INFO/System.out(717): debugger has settled (1480)
12-23 16:43:32.299: ERROR/ActivityThread(717): Failed to find provider info for com.google.settings
12-23 16:43:33.738: INFO/MapActivity(717): Handling network change notification:CONNECTED
12-23 16:43:33.738: ERROR/MapActivity(717): Couldn't get connection factory client
12-23 16:43:34.879: DEBUG/dalvikvm(717): GC freed 4012 objects / 232976 bytes in 97ms
12-23 16:43:37.818: INFO/ActivityManager(565): Displayed activity com.bbc.HelloMapView/.HelloMapView: 8939 ms
12-23 16:43:38.408: DEBUG/dalvikvm(717): GC freed 8198 objects / 604808 bytes in 90ms
12-23 16:43:38.888: INFO/InetAddress(717): Unknown host www.google.com, throwing UnknownHostException
12-23 16:43:40.488: INFO/InetAddress(717): Unknown host www.google.com, throwing UnknownHostException
12-23 16:43:42.097: INFO/InetAddress(717): Unknown host www.google.com, throwing UnknownHostException
12-23 16:43:43.307: DEBUG/dalvikvm(612): GC freed 4040 objects / 229536 bytes in 123ms
12-23 16:43:43.789: INFO/InetAddress(717): Unknown host www.google.com, throwing UnknownHostException
12-23 16:43:45.387: INFO/InetAddress(717): Unknown host www.google.com, throwing UnknownHostException
12-23 16:43:46.978: INFO/InetAddress(717): Unknown host www.google.com, throwing UnknownHostException
12-23 16:43:48.428: DEBUG/dalvikvm(656): GC freed 2771 objects / 170824 bytes in 234ms
12-23 16:43:48.708: INFO/InetAddress(717): Unknown host www.google.com, throwing UnknownHostException
12-23 16:43:50.298: INFO/InetAddress(717): Unknown host www.google.com, throwing UnknownHostException
12-23 16:43:51.898: INFO/InetAddress(717): Unknown host www.google.com, throwing UnknownHostException
12-23 16:43:53.277: DEBUG/dalvikvm(717): GC freed 5333 objects / 338584 bytes in 140ms
12-23 16:43:53.408: INFO/InetAddress(717): Unknown host www.google.com, throwing UnknownHostException
12-23 16:43:53.447: DEBUG/dalvikvm(636): GC freed 2913 objects / 165264 bytes in 244ms
12-23 16:43:56.527: INFO/InetAddress(717): Unknown host www.google.com, throwing UnknownHostException
12-23 16:43:58.329: DEBUG/dalvikvm(610): GC freed 3249 objects / 193992 bytes in 122ms
12-23 16:43:59.169: INFO/InetAddress(717): Unknown host www.google.com, throwing UnknownHostException
12-23 16:44:02.518: INFO/InetAddress(717): Unknown host www.google.com, throwing UnknownHostException

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

忘东忘西忘不掉你 2024-08-22 09:29:46

做了同样的事情,将“”移到“上面”


<uses-permission android:name="android.permission.INTERNET" />

<application android:icon="@drawable/icon" android:label="@string/app_name">
 <uses-library android:name="com.google.android.maps" />

    <activity android:name=".HelloMapView"
              android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

</application>

Did the same thing, moved the "" above the "


<uses-permission android:name="android.permission.INTERNET" />

<application android:icon="@drawable/icon" android:label="@string/app_name">
 <uses-library android:name="com.google.android.maps" />

    <activity android:name=".HelloMapView"
              android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

</application>

调妓 2024-08-22 09:29:46

您是否在清单文件中设置了互联网权限?

我相信你一定刚刚检查过:)

are you setting the internet permission in the manifest file??

I am sure you must have just checking:)

恰似旧人归 2024-08-22 09:29:46

对我来说,我将权限放在清单文件中的错误位置。它不应该位于应用程序节点内,而应该与应用程序节点处于同一级别。

for me I put the permission in the wrong place in Manifest file. It shouldn't be within application node, instead it should be at the same level as application node..

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文