简体中文
路径 | 文件 |
---|---|
uniMPSDK\Features\libs | baidu-libs-release.aar, geolocation-baidu-release.aar |
在主工程的build.gradle文件配置dependencies
android {
xxxxxxxx
defaultConfig {
xxxxxxxx
}
}
dependencies {
xxxxxxxx
implementation files('libs/baidu-libs-release.aar')
implementation files('libs/geolocation-baidu-release.aar')
}
需要在application节点前添加权限
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>
<uses-permission android:name="android.permission.READ_LOGS"/>
<uses-permission android:name="android.permission.WRITE_SETTINGS"/>
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
application节点下配置如下代码
<meta-data
android:name="com.baidu.lbsapi.API_KEY"
android:value="%申请的APPKEY%"></meta-data>
<service
android:name="com.baidu.location.f"
android:enabled="true"
android:process=":remote"></service>
路径 | 文件 |
---|---|
uniMPSDK\Features\libs | amap-libs-release.aar, geolocation-amap-release.aar |
注意事项:
将表格中的文件拷贝至主Module中的libs下。
在主工程的build.gradle文件配置dependencies
android {
xxxxxxxx
defaultConfig {
xxxxxxxx
}
}
dependencies {
xxxxxxxx
implementation('com.amap.api:location:xxx')
}
注意事项:
需要在application节点前添加权限
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>
<uses-permission android:name="android.permission.READ_LOGS"/>
<uses-permission android:name="android.permission.WRITE_SETTINGS"/>
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
application节点下配置如下代码
<meta-data android:name="com.amap.api.v2.apikey" android:value=\"%用户申请的APPkey%\"></meta-data>
<service android:name="com.amap.api.location.APSService"></service>