Use of Baidu maps under Android Studio (i)--Environment building

Source: Internet
Author: User
Tags sha1

Recently there are students to do graduation design, will use the location and map information functions, hereby studied for your reference, Baidu Positioning SDK has been updated to 5.0, the Map SDK has been updated to 3.5, but there are some instability in the use of androidstudio in the situation, In this chapter we use the Location SDK 4.0,map SDK 3.0, below we start to build the environment.

First step: Apply key

Baidu Maps Android SDK provides all the services are free, interface use Unlimited. However, you will need to apply for the key (key) before you can use the Baidu maps Android SDK. And you have to register a Baidu account.

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

Click Create app in this screen

Select the application type in this screen and enter the security code

  The entry rules for the security code are:

The SHA1 value of the Android signing certificate + ";" +packagename (i.e.: digital signature + semicolon + package name),

  Get SHA1 Value:

Run into the console

  Enter. Android (Reference): Enter Keytool-list-v-keystore debug.keystore, password is Android

Copy the package name to Androidmainifest.xml

Successfully created key

After entering the security code, click "OK" to complete the application configuration work, you will get a key created.

Step two: Download Baidu SDK

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

Step three: Android Studio project configuration Method

1, in the project App/libs directory into the Baidumapapi_vx_x_x.jar package, in the src/main/directory under the new Jnilibs directory, put Libbaidumapsdk_vx_x_x_ X.so as shown, note that the first 3-bit version number of the jar and so must be the same, and that the two files in the folder you downloaded once are guaranteed to be used without the jar or so of different functional components.

2. Import the jar package. Menu bar Select File->project structor->modules->dependencies, click the + sign, select File dependency, select the Jar package import.

Fourth step: Add key to Androidmainifest.xml
< Meta-data             Android:name = "Com.baidu.lbsapi.API_KEY"             android:value= "Enter the requested key"/>

By the end of this environment, we'll look at how to use it in the next chapter.

Jerry Education
Source:http://www.cnblogs.com/jerehedu/
Copyright Notice: The copyright of this article belongs to cigarettes DeskJerry EducationSection Technology Co., Ltd. and blog Park are shared, welcome reprint, but without the consent of the author must retain this paragraph, and in the article page obvious location to the original link, otherwise reserves the right to pursue legal responsibility.
Technical Consultation:

Use of Baidu maps under Android Studio (i)--Environment building

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.