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

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.

主站蜘蛛池模板: 江北区| 陆丰市| 利辛县| 开化县| 三河市| 甘肃省| 泌阳县| 托克逊县| 莱西市| 叶城县| 绍兴县| 大姚县| 苏尼特右旗| 香格里拉县| 遂宁市| 裕民县| 新巴尔虎左旗| 黑水县| 水城县| 和田市| 航空| 北宁市| 满城县| 连南| 榆社县| 黑龙江省| 广宁县| 宣威市| 漳浦县| 闵行区| 宁国市| 孝义市| 丘北县| 中方县| 鄂尔多斯市| 旬邑县| 武鸣县| 嘉祥县| 准格尔旗| 彩票| 竹溪县|