谷歌地图可以在模拟器,但不是在Android设备中显示是在、模拟器、但不、地图

2023-09-06 13:13:47 作者:22.柠萌小仙女

我已经获得的谷歌地图API密钥以仿真器上运行,但是当我在真正的Andr​​oid设备上运行该程序时,地图显示不出来。 我读过一些解决方案,说我必须获得来自谷歌的释放键,但该解决方案并没有告诉我,我怎样才能得到这些关键

I already get the Google map API key to run on the emulator, but when I run the program on real android device, the Map doesn't show up. I've read some of the solution that said that I have to get the release key from Google, but the solution doesn't tell me HOW can I get those key

推荐答案

这不仅是对Android应用程序密钥库或Android地图API密钥。它是两者的结合。我们需要密钥库时,我们要签一个应用程序。

It is not only about the Android app keystore or the Android Maps API Key. It is a combination of both. We need the keystore when we want to sign a App.

您可以注册一个应用程序的方法是如下; (我假设你正在使用的Eclipse IDE发出指示)

The way you can sign a App is as follow; (I am giving instructions by assuming that you are working with Eclipse IDE)

右键点击您的项目在Package Explorer窗口 在Android的工具 - >导出签名的应用程序包 在项目检查窗口,眉头您的项目,并进入下一窗口 在这里,选择创建新的密钥库,并按照向导 请不要放弃附带Eclipse调试默认密码 关键 Right click on your project in the Package Explorer window Android Tools -> Export signed application package In Project Checks window, brows your project and go to next window There, select "Create new keystore" and follow the wizard Don't give the default password which comes with the Eclipse debug key

然后就可以完成创建签名密钥,以便您的应用程序。 接下来的程序是Android地图API密钥的注册过程。在这里,我假设你正在做的在Windows环境下实现

Then you can finish creating a signed key for your app. Next procedure is Android Maps API Key Signup process. Here I am assume that you are doing implementation in a Windows environment

开启命令提示符 转到您保存您的密钥存储文件中的previous过程中的地方 发出命令的keytool -list -keystore keystore.filename的不带引号 他们会问密钥库密码,提供创建密钥库给予相同的密码 然后你就可以得到一个MD5密钥 复制它,走这链接 Open command prompt Go to the place where you have saved your keystore file in previous process Give the command "keytool -list -keystore keystore.filename" with out quotes They will ask "keystore password", provide the same password given in creating the keystore Then you can get a MD5 key Copy it and go this link

上给予适当的位置MD5密钥,提供蜱。那么谷歌的人会为您提供一个XML code。你必须插入XML文件中的code,你需要加载地图。

Give the MD5 key on the appropriate place, provide the tick. Then the Google people will provide you a XML code. You have to insert that code in the XML file where you need to load the map.

太好了......现在你已经创建了支持谷歌是在模拟器上运行地图API以及实际设备的应用程序。 : - )

Bingo... now you have created an App which support Google map API that runs on a emulator as well as real device. :-)

 
精彩推荐
图片推荐