Android studio--Baidu positioning Integration 001

Source: Internet
Author: User

Android's current megatrends are already widespread using Androidstudio (install package [https://yunpan.cn/ckc54idj3JVJb access password 664f]). This is a good environment for integration.

Today to engage in a Baidu positioning integration.

First look at the Baidu Positioning SDK.

See this 4 step, we actually follow this to come.

First step: Request a key

Here's what to look for:

Someone doesn't know what SHA1 is?

is the ecplise to develop the Android project when the creation of the certificate turned to look.

View please refer to: http://blog.csdn.net/forlong401/article/details/44120547

Step Two: Configure the integration environment

Since we want to use Baidu's positioning, it is necessary to integrate the relevant classes provided by Baidu to call his related interface (commonly known as the SDK). SDK Download

Unzip after download is complete

Next configure the Baidu SDK in the so file read

Next set

Set Androidmanifest.xml

Permissions used by claims

<!--this permission for network positioning--><uses-permission android:name= "Android.permission.ACCESS_COARSE_LOCATION" ></ uses-permission><!--This permission to access the GPS location--><uses-permission android:name= "Android.permission.ACCESS_FINE_ Location ></uses-permission><!--to access WiFi network information, WiFi information will be used for network positioning--><uses-permission android:name= "Android.permission.ACCESS_WIFI_STATE" ></uses-permission><!--get carrier information to support interfaces that provide carrier information-->< Uses-permission android:name= "Android.permission.ACCESS_NETWORK_STATE" ></uses-permission><!-- This permission is used to get WiFi access, WiFi information will be used for network location--><uses-permission android:name= "Android.permission.CHANGE_WIFI_STATE" ></uses-permission><!--used to read the current status of the phone--><uses-permission android:name= "android.permission.READ_ Phone_state "></uses-permission><!--write extended storage, write data to the expansion card for writing offline location data--><uses-permission android:name = "Android.permission.WRITE_EXTERNAL_STORAGE" ></uses-permission><!--access network, network location requires internet-->< Uses-permissionAndroid:name= "Android.permission.INTERNET"/><!--SD card Read access, user writes offline location data--><uses-permission android:name= "Android.permission.MOUNT_UNMOUNT_FILESYSTEMS" ></uses-permission>

  

Set Acesskey
<meta-data            android:name= "Com.baidu.lbsapi.API_KEY"            android:value= "key"/>       //key: Developer Application KEY

Okay, here's the SDK integration done.

Android studio--Baidu positioning Integration 001

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.