官术网_书友最值得收藏!

Google Maps

Google Maps is used in the app for finding the location of a place, or to navigate you to that place. Integrating Google Maps in the app is simple; check out the steps below:

First we need to enable the Google Maps API from the Developer Console link: https://console.cloud.google.com. In your project page select Library; then, under Google Maps APIs, select Google Maps Android API:

Next, enable the API so that it can be used in our application. After the Google Maps API is enabled, we need to start integrating it into our app:

In Android studio create a new Google Maps Activity:

After the activity is created, we need to create an API key from the developer console:

Go to the credentials section in the developer console, and create a new API key:

Here, select Android app and enter your app's package name and Sha-1 certificate. After saving the API key, use the key in your app.

Now in your app, add the dependency in your app's build.gradle file:

Compile com.google.android.gms:play-services-maps:10.0.1.

Create a string resource google_maps_key strings.xml with the value of the API key. Save the file.

After adding, save the AndroidManifest.xml and re-build your application.

主站蜘蛛池模板: 怀集县| 兴和县| 固安县| 伊春市| 拉萨市| 肇源县| 长泰县| 商城县| 卫辉市| 莲花县| 枝江市| 来宾市| 上林县| 清新县| 天门市| 逊克县| 太保市| 韩城市| 苍溪县| 通榆县| 高邑县| 桃江县| 大石桥市| 土默特右旗| 凌云县| 图们市| 鄯善县| 永顺县| 灵丘县| 白河县| 泰和县| 迭部县| 台安县| 汶川县| 镇坪县| 白城市| 黎川县| 舟曲县| 乌兰察布市| 葫芦岛市| 沈丘县|