1. Preparatory work
1. Create an own project on Gaode map developer platform
Fill in the name and application type at will
2. Add Key
1. Add key
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
2.2. Configure the path of keytools in the environment variable
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
get your SHA1 value, and then you can After the creation is complete, you will get the key
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,
and configure it in your project
//导入高德地图的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)