我正在尝试在
Android模拟器上运行
Android Hello Map View教程应用程序.将显示Google地图视图,但图块为空白.
根据以下错误判断(取自LogCat),该应用程序无法连接到互联网.模拟器上的Web浏览器连接没有问题.我还仔细检查了API密钥.
我在Windows XP SP3上使用来自Eclipse galileo的1.5 Google Api SDK,位于企业防火墙后面.
>将-http-proxy http://www.foo.co.uk:80添加到调试配置中目标页面中的其他仿真器命令行选项.
>删除1.中的设置并在主页>处添加代理信息菜单>设置>无线控制>移动网络>接入点名称.
似乎都没有帮助.
还有其他想法吗?我应该在应用程序中添加代理信息吗?如果是这样,怎么样?
萨姆达顿
修订:清单应用程序元素中添加了Internet权限:
<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
解决方法
做了同样的事情,把“”移到了“”之上
<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>