【仅供内部供应商使用,不提供对外解答和培训】
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
compile fileTree(include: ['com.fr.android:report-sdk:+' // 添加SDK report模块依赖 compile *.jar'], dir: 'libs') // 依赖部分jar包文件 compile ('com.fr.android:bi-sdk:+', {// BI功能对应模块. // 添加SDK 可能的冲突版本 bi模块依赖需要排除 //compile 'com.fr.android:core:+' exclude group: 'com.google.zxing', // 添加SDK 核心模块依赖module: 'core' //compile 'com.fr.android:platform:+' //exclude 添加SDK 核心模块依赖 //compile group: 'com.fr.android:gis:+'jiechic.library', module: 'xUtils' // // 添加SDK 地图模块依赖 //compileexclude group: 'com.fr.android:location:+'android.support', module: 'appcompat-v7' // // 添加SDK 定位模块依赖 //compileexclude group: 'com.fr.android:vpn:+'android.support', module: 'recyclerview-v7' }) // 添加SDK vpn模块依赖 //compile ('com.fr.android:pushreport-xgsdk:+', {// 报表对应模块. // 添加SDK 推送模块依赖 |
...
4. 在该模块清单文件的application标签中添加属性
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
tools:replace="android:allowBackup, android:label, android:icon, android:theme" // 替换SDK清单文件中allowBackup, label, icon, theme等属性的值 |
5. 项目本身需要做的工程引用. 其中core. platform为核心模块, bi report为顶层模块. vpn location xg push为可选模块.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
compile 可能的冲突版本 需要排除 // exclude group: 'com.google.zxing', module:core:3.1.0'// 内部使用 compile 'core' // exclude group: 'com.jiechic.library', module:xUtils:2.6.14' compile 'xUtils' // exclude group: 'com.android.support', module: 'appcompat-v7:23.2.0' compile' // exclude group: 'com.android.support', module: 'recyclerview-v7:23.4.0' compile fileTree(include: ['*.jar'], dir: 'libs') compile ('com.fr.android:report-sdk:+', {}) // 报表功能对应模块.根据需要加载对应的插件模块 transitive = false }) compile ('com.fr.android:bi-sdklocation:+', {// BI功能对应模块.定位插件,获取经纬度 transitive = false }) compile ('com.fr.android:platformvpn:+', {// 核心功能 框架 transitive = false }) compile ('com.fr.android:core:+', { // 核心模块. VPN插件,登录Sangfor VPN 服务器 transitive = false // 去除对应lib内部引用 }) compile ('com.fr.android:gis:+', {// 可选插件 Gis地图功能. transitive = false }) compile ('com.fr.android:location:+', {// 可选插件 定位功能.GIS插件,显示GIS地图图表 transitive = false }) compile ('com.fr.android:vpnpush-xg:+', {// 可选插件 vpn功能. transitive = false }) compile ('com.fr.android:push-xg:+', {// 可选插件 信鸽推送功能. transitive = false })// 推送插件, 集成信鸽推送服务 |
添加后,build.gradle如下所示
4. 在该模块清单文件的application标签中添加属性
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
tools:replace="android:allowBackup, android:label, android:icon, android:theme" // 替换SDK清单文件中allowBackup, label, icon, theme等属性的值 |
如上,工程配置完毕,FR SDK已经成功添加到您的项目中,之后可以直接引用FR相关的API,进行集成开发。您也可以参考OEM_demo和SDK_demo中的项目结构和build.gradle文件,进行工程配置。gradle文件,进行工程配置。各插件模块的使用,请参考相关插件文档。