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

时间:2009-12-23 16:53:41

标签: android android-emulator android-mapview

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

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

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

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

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

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

  3. 似乎都没有帮助。

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

    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
    

4 个答案:

答案 0 :(得分: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>

答案 1 :(得分:1)

您是否在清单文件中设置了Internet权限?

我相信你一定要检查:)

答案 2 :(得分:1)

答案 3 :(得分:1)

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