Use of Baidu map under Android Studio (1)-Environment Building, androidstudio

Source: Internet
Author: User

[Switch] use of adding Baidu map under Android Studio (1)-Environment Building, androidstudio

Recently, some students want to design a graduation project and use the positioning and MAP information functions. I have studied this for your reference. Baidu positioning SDK has been updated to 5.0, the map sdk has been updated to 3.5, but there are still some unstable situations in use in AndroidStudio. In this chapter, we use the positioning SDK 4.0 and map sdk 3.0. Next we will start to build the environment.

Step 1: Apply for a Key

All services provided by Baidu map Android SDK are free of charge, and there is no limit on the number of times the interface is used. However, you must apply for a key before using the Baidu map Android SDK. You must register a Baidu account.

Web: http://lbsyun.baidu.com/apiconsole/key

Click Create application in this screen

Select the application type and enter the security code.

  The rules for entering security codes are as follows:

The sha1 value of the Android signature certificate + ";" + packagename (I .e., digital signature + semicolon + package name ),

  Get sha1 value:

Run and enter the Console

Go to. android (reference): Enter keytool-list-v-keystore debug. keystore,The password is android

 

Copy the package name to AndroidMainifest. xml.

KEY created

After entering the security code, click "OK" to complete the application configuration. A Key is created.

Step 2: Download Baidu SDK

: Http://developer.baidu.com/map/index.php? Title = androidsdk/sdkandev-download

Step 3: Android Studio project configuration method

1. Put the baidumapapi_vX_X_X.jar package under the job app/libs directory, create the jniLibs directory under the src/main/directory, and put libBaiduMapSDK_vX_X_X_X.so directory, as shown in, note that the first three versions of jar and so must be consistent, and the two files in the downloaded folder must be used at a time. jar or so files of different functional components cannot be used in combination.

 

2. Import the jar package. Choose File> Project Structor> Modules> Dependencies from the menu bar, click the plus sign, SELECT File dependency, and select jar package import.

Step 4: add the Key to AndroidMainifest. xml
<Meta-data android: name = "com. baidu. lbsapi. API_KEY" android: value = "Enter applied key"/>

After the environment is set up, let's take a look at how to use it in the next chapter.

 

Author: Jerry Education
Source: http://www.cnblogs.com/jerehedu/
Copyright Disclaimer: The copyright of this article is shared by Yantai jereh Education Technology Co., Ltd. and the blog Park. You are welcome to repost it. However, you must keep this statement without the consent of the author and provide the original article connection clearly on the article page, otherwise, you are entitled to pursue legal liability.
Technical Consultation:

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.