Android——location service (Baidu map development platform configuration)

Step 1: First apply to become a certifier of Baidu development platform
URL: Baidu development platform
Then fill in the relevant information, and then submit (this step is omitted)
Step 2:
After the application is successfully created , click the console-application management-my application – Creating an application

will pop up the following information that needs to be filled:

Application name customization,
Android SDK
SHA1 needs to be selected in the android studio software, and Gradle that comes with the system is generally on the rightmost toolbar by default,

and then click signingReport

and then SHA1 is obtained A test version signature file automatically generated by the system
Insert picture description here
. Then fill in the application creation form and submit it. You will get a unique ak key.
Insert picture description here
Then we download the LBS SDK development kit (the first one)

Select the two functions of basic positioning and basic map

Then unzip it will get the following files:


Among them, BaiduLBS_Android.jar is needed by the java module. Copy it to the app/libs directory of the androidstudio project.
Then create a package named jniLibs in the main directory, and copy the remaining 5 folders to This

emphasizes: the package name must be jniLibs, because andrid studio loads the NDK directory by default as jniLibs,
otherwise the following exception will pop up

java.lang.UnsatisfiedLinkError: No implementation found for int com.baidu.mapsdkplatform.comjni.tools.JNITools.initClass

build-gradle闭包中会自动添加` implementation fileTree(dir: 'libs', include: ['*.jar'])

Then we click the sync button (the one on the far left).
Insert picture description here
When the jar package under our libs package has a right arrow, it means that these jar packages can be referenced. The
previous configuration ends here, and the next article enters the official code.

Guess you like

Origin blog.csdn.net/News53231323/article/details/113825267