3

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
4

4 回答 4

4

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


<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>

于 2010-11-17T01:30:59.207 回答
1

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

于 2010-08-24T08:31:35.403 回答
1

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

我相信你一定只是检查过:)

于 2009-12-23T17:24:19.933 回答
1

看起来这是一个错误:问题 3764:谷歌地图通过强制网络代理失败

于 2009-12-24T14:50:44.807 回答