本人微信公众号"aeolian"~

百度定位SDK

按照官网要求配置SHA1和包名生成ak秘钥

生成秘钥命令: keytool -list -v -keystore debug.keystore

密码:原始密码为android

添加libs文件夹并在gradle中配置,显示为jniLibs,可以直接创建libs文件夹然后在配置。也可以右击app->new->Folder->JNI Folder

《百度定位SDK》

在AndroidManifest.xml文件Application中,配置AK

<meta-data
    android:name="com.baidu.lbsapi.API_KEY"
    android:value="开发者申请的AK" >
meta-data>

在Application标签中声明service组件

<service android:name="com.baidu.location.f" android:enabled="true" android:process=":remote"> service>

在AndroidManifest.xml中添加权限


<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION">uses-permission>

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION">uses-permission>

<uses-permission android:name="android.permission.ACCESS_WIFI_STATE">uses-permission>

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE">uses-permission>

<uses-permission android:name="android.permission.CHANGE_WIFI_STATE">uses-permission>

<uses-permission android:name="android.permission.READ_PHONE_STATE">uses-permission>

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE">uses-permission>

<uses-permission android:name="android.permission.INTERNET" />

<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS">uses-permission>

这里面不像百度地图SDK,定位SDK不用在build.gradle中配置debug.keystore

然后就可以了

《百度定位SDK》

 

点赞

Leave a Reply

Your email address will not be published. Required fields are marked *