问题
We are using a Google MapView in our application but on different computers we must use different API keys, otherwise the MapView doesn\'t display anything.
Is there a way to set one key for all developers?
回答1:
Is there a way to set one key for all developers?
For the debug signing key, copy your debug keystore (e.g., ~/.android/debug.keystore) between developer PCs, and remember to update all of them again when that keystore expires.
For the production signing key, copy the production keystore between developer PCs.
Note that I have not tried copying keystores between Windows and non-Windows (OS X, Linux), so I don't know if there are any possible issues there related to line endings.
回答2:
Yes you can use common key to make MapView visible in all Device by using Release Key.
- Get the
MD5 Keyfrom your computer and Go to Googles link for gettingMap Keyand get yourUnique keyfor your system. - Copy and paste it in
XMLfile - Now right click Project->Export Application->Select your Project->Next->Select new Keystore -> Complete all rest Steps
- Note down your alias name and password given.
- Now if you Complete all process of Filling Details you will get one
.apkfile and keystore file in your stored location. - Now open commamd prompt type this command in it --> Got to you Java bin path ->
keytool.exe -list -alias "aliasname" -keystore "location of keystore generated" -storepass "password" -keypass "password" - Now hit ENTER you will get
MD5again - Now copy it paste it in in
Google Keylink and get your key. - Now go to your
XMLput the new key inXMLfile. - Now Right Click Project->Export Application->Select your Project->Next->Use Existing Keystore -> Give location and password->Next
- Now your alias name will comes in your Drop Down->Select it -> Enter Password -> Next
- It will ask for location to store your final
.apkfile. - Select your location and store.
Now this final
.apkfile will showsMAPVIEWin all Devices.C:\Users\FSSD6>keytool.exe -list -alias aliasname -keystore "location" -storepass password -keypass password
For Further help check this Maplink and this blog post
来源:https://stackoverflow.com/questions/7444392/one-google-maps-key-for-all-developers