如何在 Android 地图活动中显示地图?

发布于 2024-07-26 15:42:22 字数 86 浏览 4 评论 0原文

我已将地图视图附加到我的布局中,并显示指南针和我当前的位置。 我遇到的问题是,视图中没有显示街道地图,所以基本上我只是在空白网格上看到指南针和我当前的位置。

I have attached a mapview to my layout and have a it showing a compass and my current location. The problem I have is, that there is no street map shown in the view, so basically I just see the compass and my current location over a blank grid.

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

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

发布评论

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

评论(4

离鸿 2024-08-02 15:42:22

当您通过 Eclipse 运行或调试时,您的应用程序将使用自动创建的调试密钥进行签名。 它与您在发布应用程序时签署应用程序的密钥不同。

您需要使用调试密钥获取 API 密钥。

请参阅 上的“获取 SDK 调试证书的 MD5 指纹”部分http://code.google.com/android/add-ons/google-apis/mapkey.html

准备好发布应用后,您可以将调试 API 密钥替换为您当前使用的 API 密钥。

When you run or debug through Eclipse your app is signed with your debug key which will have been automatically created. It is not the same as the key you sign your app with when releasing it.

You need to get an API key using your debug key.

See the 'Getting the MD5 Fingerprint of the SDK Debug Certificate' section on http://code.google.com/android/add-ons/google-apis/mapkey.html

Once you are ready to release your app, you replace the debug API key with the API key you are currently using.

一梦浮鱼 2024-08-02 15:42:22

确保您拥有 INTERNET 权限和正确的 API 密钥。 其中任何一个都会给你空白网格效果。

http://code.google.com/android/add- ons/google-apis/mapkey.html

Make sure you have the INTERNET permission and a proper API key. Either of those will give you the blank grid effect.

http://code.google.com/android/add-ons/google-apis/mapkey.html

与他有关 2024-08-02 15:42:22

事实证明,仅当使用 adb install {app 的路径} 对应用程序进行签名和上传时才会显示地图,当我使用 Eclipse 运行或调试时,同一个应用程序无法工作。

Turns out the map is only shown when the app is signed and uploaded using adb install {path to app}, the same app didn't work when I run or debug using Eclipse.

薄荷梦 2024-08-02 15:42:22

查看以下内容:
1. 包括一罐地图。
2. 生成您的证书并注册。 现在应该可以了
:)

Check out the followings:
1. include jar of maps.
2. generate your certificate and register it. It should work now
:)

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