开发者

How to put an Android debug keystore into a subversion repository and then getting Eclipse to use it?

In order to use the Google Maps API, Google requires the MD5 fingerprint of a keystore:

  • To display Maps data in a MapView, you need to register for a Maps API Key
  • Each Maps API Key is uniquely associated with a specific certificate, based on an MD5 fingerprint of the certificate
  • You can register multiple certificates under your developer identity
  • You can get a temporary Maps API Key based on your debug certificate, but before you publish your application, you must register for a new Key based on your release certificate and update references in your MapViews accordingly

We have multiple people who are going to be using the Google Maps API and we are using Subversion to track everything. It seems a lot easier if all the developers simply point at the same keystore but the Eclipse IDE doesn't seem like it has a way to point at more than one keystore and each developer works on multiple projects.

Is there a way to get Eclipse to use a keystore in the current Subversion repository without being a hassle (i.e. without having开发者_开发知识库 to change preferences all the time)?

Or should there be a new SVN repository dedicated solely to managing the debug keystore for all of our devs?

How are you doing this at your organization?


Basically, default debug keystore is stored in /Users/{NAME}/.android/debug_keystore

  1. Set SVN Repository and Checkout to the computer, which contains the file “debug.keystore”
  2. In Eclipse, File->Preference->Android->Build.
  3. Set “Custom debug keystore” to “debug.keystore” file in SVN Checkout Directory

http://chrislee.kr/wp/2010/12/31/share-google-android-api-key-in-eclipse-with-other-team-members/


  1. It is easier if you add all developers debug keys to google-play-services and generate one Api key for all of them. Much more is complicated for all of developers to get debug key from repo and setup it in eclipse. Google Maps Api v2 for sure allows to add more then one SHA1;com.package.name lines to get one Api key.. (btw that is the way to do it..)

  2. Puting maps key in string.xml resource file is probably the most unsecure solution. Apk can be relatively easy reverse engineered and the easiest files to read are resources (among those xml files)

  3. Making repo just for debug keys is IMHO way to overhead...

maybe it is just me..but..

I hope this answer really helped you and others.. ;)


We ended up putting the Maps key into the strings.xml file and then referencing it that way. There are a couple of different ways to start a MapActivity in our application. So that makes it easy to go live when we are ready - just replace the key in the one location and then it is basically ready to submit to the Market.

We also set up a single Subversion repository whose sole purpose in life is to house the debug keystore and Maps API keys and anything else in the future that is keystore-specific. All of the developers now point at that single debug keystore from within Eclipse and the app works like a charm.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜