Maps v2 API Key on Android

假装没事ソ 提交于 2019-12-09 13:48:29

问题


I went to https://code.google.com/apis/console/

I then did this:

keytool -v -list -alias ks_ms_ad -keystore W:\eclipse-android-sign\keystore\exampleproject

I converted the output

SubjectKeyIdentifier [
KeyIdentifier [
0000: HH HH HH HH HH HH HH HH   HH HH HH HH HH HH HH H  /x<s7.@...B.).8.
0010: HH HH HH HH                                        .. .
]
]

to

HH:HH:HH:HH:HH:HH:HH:HH:HH:HH:HH:HH:HH:HH:HH:HH:HH:HH:HH:HH;com.exampledomain.exampleproject

Google actually accepted this, so somehow I turned gibberish into something usable. The "HH" entries matched up with the example given in Google's API console site, so there is a small chance what I did was actually correct.

But above does not seem like how I read it should be? Am I really supposed to do the editing I did? I thought I would get a ready to use md5 from keytool?

I am getting a blank screen witgh zoom buttons [+] [-] which is partly why I think there may be a problem?


回答1:


Seem the cause was I had messed up. (You find SHA1 etc. above what I referenced) So just for for others messing around with this:

debug keytool fingerprint example:

keytool -list -v -keystore "C:\Users\%your name%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
HH:HH:HH:HH:HH:HH:HH:HH:HH:HH:HH:HH:HH:HH:HH:HH:HH:HH:HH:HH;com.company.product

release keytool fingerprint example:

keytool -v -list -alias youralias -keystore W:\keystore\product
HH:HH:HH:HH:HH:HH:HH:HH:HH:HH:HH:HH:HH:HH:HH:HH:HH:HH:HH:HH;com.company.product

All above can then share the same API key which will have pattern:

a-zA-Z0-9- 

You can get the API key here: https://code.google.com/apis/console/

And find keytool.exe here (example) C:\Program Files\Java\jre7\bin




回答2:


I think there was an issue with your key itself in the way it has been signed. The fingerPrint seems odd. Pls. check the SHA1 fingerPrint. Ohk. looks like you have found the issue.



来源:https://stackoverflow.com/questions/15294299/maps-v2-api-key-on-android

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!