Integrate Gaode map SDK in Android to realize map positioning and navigation functions (1)

1. Preparatory work

1. Create an own project on Gaode map developer platform

this
Fill in the name and application type at will

2. Add Key

1. Add key
insert image description here
2. Obtain SHA1 value
2.1. Use windwos+R to enter cmd to open the control window and enter where keytool to obtain the path of keytool insert image description here
2.2. Configure the path of keytools in the environment variable
insert image description here
2.3 Then enter keytool -v -list in the cmd window - The keystore is followed by your signature certificate, mine is keytool -v -list -keystore C:\Users\86181.android\debug.keystore keystore password is android; this can
insert image description here
get your SHA1 value, and then you can After the creation is complete, you will get the key
insert image description here
2.4, then open the homepage of the Amap developer platform and open the development support, then open the SDK of the android map, find the relevant download,
insert image description here
and configure it in your project
insert image description here

 //导入高德地图的SDK 切记不要盲目粘贴,可能出现一些问题,最好是用自己下载的aar包
 implementation(name: 'AMap3DMap_9.6.0_AMapNavi_9.7.0_AMapSearch_9.5.0_AMapLocation_6.3.0_20230414',ext:'aar')

The key point is to add the dependency of using the lib package to build.gradle

 repositories {
    
    
        google()
        mavenCentral()
        jcenter()
        flatDir {
    
    
            dirs 'libs'   //必须要加入这个,因为我们是手动配置高德地图的SDK
        }
 }

The preliminary work of integrating the map has been completed. In the next chapter, we will implement the map effect. Please refer to my next article: Integrating the Gaode Map SDK in Android to realize map positioning and navigation functions (1)

Guess you like

Origin blog.csdn.net/Qinbenjiaren/article/details/130741070