Is it possible to use Maps and place API with same API KEY
Asked Answered
W

5

5

I was tiring to build an app which uses google maps for showing places and Pace API for searching places. but it is not being possible to build the app with two different API keys in the manifest. So, I want to Know if it is possible to access both Maps and Place API with the same API key..? or There is some other way for doing this.

Wirewove answered 4/5, 2016 at 9:38 Comment(0)
R
6

Yes! you can use same key on both of and also you can use only one key for all Google API

See below image in listed all google api and see this link.

enter image description here Now you have to Enable all of api, Here must enable API you have require in your app. see this

enter image description here

Note:

You have to create API key for particular platform different platform for different API key you have to create. See below image

Android API key Create New API

Now get Stared with this Link

Rileyrilievo answered 4/5, 2016 at 10:10 Comment(1)
You answer was the most resource full, Thanks for help.Wirewove
F
5

First of all go to Google Api Console and select your project enter image description here

And select api you want to enable like google Map Api or google place api. Enable your api.

enter image description here

Add api key in application tag of Manifest like

<meta-data
    android:name="com.google.android.gms.version"
    android:value="@integer/google_play_services_version" />

<meta-data
    android:name="com.google.android.maps.v2.API_KEY"
    android:value="@string/map_api_key" />

if you are using both Map and Geo Api.then only add geo api(it will work for both)

<meta-data
        android:name="com.google.android.geo.API_KEY"
        android:value="@string/place_api_key" />
Farleigh answered 8/2, 2017 at 6:30 Comment(0)
T
1

yes you can use same key for both services

http://javapapers.com/android/find-places-nearby-in-google-maps-using-google-places-apiandroid-app/

https://examples.javacodegeeks.com/android/android-google-places-api-example/

Tribunal answered 4/5, 2016 at 9:40 Comment(1)
but How, Can you please show me an example, or tell me the process..?Wirewove
D
1

Yes you can use the Same Key for Both Functionality.

Note : Make sure when you Create API Key You need to Enable both API Google Map and Google Places API.

From Google Console. Where you have Created your Project. That's It.

After that Both API will Work with Single API Key.

EDIT 1:

  1. Create Project using this Link If you havn't Created your Project in Google Console.

  2. Then after select created project from list of projects you have.

  3. It will show you All the APIS List. From that Enable APIS which you need to use in your Project.

  4. Then add your Generated API Key in Manifest Android. That's It.

Distiller answered 4/5, 2016 at 9:46 Comment(0)
M
1
  1. you have to create a project in Google Console
  2. then enable both api Google Map and Google Places API From Google Console
  3. and use that projects key in manifest. both api work fine.
Monotony answered 4/5, 2016 at 9:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.