Just finished coding an Android app and am preparing to release it to the Play Store. During development, I obtained a Google Maps API Key using my debug.keystore, and placed this key in my Manifest, like so:
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="MY_API_KEY" />
However, I've now signed my app with my release certificate, and thus got a new API key from Google Maps. For testing purposes, is there a way to keep both the old (debug) and new (release) API key in my Manifest, with a switch that loads the proper one at run time? Ex:
if (debug) {
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="DEBUG_API_KEY" />
}
else if (release) {
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="RELEASE_API_KEY" />
}
Cheers!