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

  • Expert Android Programming
  • Prajyot Mainkar
  • 199字
  • 2021-07-08 10:29:11

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.

主站蜘蛛池模板: 古田县| 东乌珠穆沁旗| 沐川县| 英山县| 靖江市| 会同县| 峨边| 布拖县| 土默特左旗| 朔州市| 汉中市| 桐庐县| 清丰县| 平顺县| 常熟市| 新郑市| 乐山市| 榆中县| 敦化市| 米易县| 吴堡县| 永新县| 宜兰县| 全南县| 水富县| 西乡县| 壤塘县| 深泽县| 鄂尔多斯市| 察隅县| 浦县| 屯留县| 永胜县| 济源市| 天水市| 绿春县| 陇西县| 珠海市| 海丰县| 那坡县| 古田县|