Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between com.google.android.geo.api_key and com.google.android.maps.v2.api_key?

I would like to know what is difference between com.google.android.geo.API_KEY & com.google.android.maps.v2.API_KEY meta tags. They are both used for setting Google Maps API Key. But cannot seem to find the difference and which is preferable to use ?

like image 921
Sameer Tanuj Avatar asked Dec 28 '17 08:12

Sameer Tanuj


People also ask

Which API do I need for Google Maps?

A web page or application displays a map using the Maps JavaScript API.

In which configuration file should we add the Api_key for the Google Maps?

So, in your Android Studio project, click File -> New -> Activity -> Gallery -> Google Maps Activity.

Can I use Google Maps v2 API and Google Places API together?

No, each service (Google Maps V2 API and Google Places API) have and will generate a different API Key. But you can't use/declare both keys in your manifest in the same time. When you are using Google Maps and Google Places just use the Google Places API key only (com.google.android.geo.API_KEY), and it will work for both.

Can I use the same API key for maps SDK for Android?

Note: You can use the same API key for your Maps SDK for Android and Places SDK for Android apps. This section describes how to store your API key so that it can be more securely referenced by your app.

What is the API version of Google Maps for Android?

2.1. MapsView Google provides via Google play a library for using Google Maps in your application. The following description is based on the Google Maps Android API v2 which provides significant improvements to the older API version.

Do I need a browser key to use Google Maps API?

You need an Android API key, not a browser key. You can use the same API key for your Google Maps Android API v2 apps and your Google Places API for Android apps. Thanks for contributing an answer to Stack Overflow!


1 Answers

From the official documentation:

Note: As shown above, com.google.android.geo.API_KEY is the recommended metadata name for the API key. A key with this name can be used to authenticate to multiple Google Maps-based APIs on the Android platform, including the Google Maps Android API. For backwards compatibility, the API also supports the name com.google.android.maps.v2.API_KEY. This legacy name allows authentication to the Android Maps API v2 only. An application can specify only one of the API key metadata names. If both are specified, the API throws an exception.

like image 156
Henry Avatar answered Sep 28 '22 03:09

Henry