0

I have a android application in which I need to load google maps in two different activity. How to use two different google map keys for each activity. Is it even possible?

Earlier I had only one API key for both activities, hence I had placed the key in meta-data in AndoridManifest.xml

        <meta-data
            android:name="com.google.android.geo.API_KEY"
            android:value="@string/GOOGLE_MAP_KEY" />

But since I now have two different key, how to handle two separate meta-data in AndroidManifest. Since, we cannot place two meta-data. Is it even possible to initialize the google maps without keeping meta-data in Android Manifest.
If yes,how to handle the same?

2
  • What would be the use case for this? I don't think this is possible because the Maps SDK automatically finds the meta-data with name "com.google.android.geo.API_KEY" and use it for loading the map and there's no documented way to modify this.
    – Yrll
    Commented May 1 at 1:22
  • @Yrll The client want to have two separate key for each activity to identify the accurate usage of each API key.
    – dev
    Commented May 1 at 5:52

0