【仅供内部供应商使用,不提供对外解答和培训】
...
2. 将解压后的libs文件夹中的完整内容复制到模块libs目录下
3 3. 打开该模块的build.gradle文件,并添加如下内容
...
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 exclude group: 'com.fr.android:core:+'google.zxing', module: 'core' // exclude // 添加SDK 核心模块依赖 //compile group: 'com.fr.android:platform:+'jiechic.library', module: 'xUtils' // // 添加SDK 核心模块依赖 //compileexclude group: 'com.fr.android:gis:+'android.support', module: 'appcompat-v7' // // 添加SDK 地图模块依赖 //compileexclude group: 'com.fr.android:location:+' android.support', module: 'recyclerview-v7' }) // 添加SDK 定位模块依赖 //compile ('com.fr.android:vpnreport-sdk:+', {// 报表对应模块. // 添加SDK 可能的冲突版本 vpn模块依赖需要排除 //compile 'com.fr.android:push-xg:+' exclude // 添加SDK 推送模块依赖 |
...
4. 在该模块清单文件的application标签中添加属性
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
tools:replace="android:allowBackup, android:label, android:icon, android:theme" // 替换SDK清单文件中allowBackup, label, icon, theme等属性的值 |
5. 若您的项目本身已经依赖的某一版本的appcompat-v7, recyclerview-v7, zxing, 可以通过gradle的exclude方法排除FR SDK中相关依赖
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
compile 'com.android.support:appcompat-v7:25.3.1' compile 'com.android.support:recyclerview-v7:25.3.1' compile 'com.google.zxing:core:3.1.0' compile('com.fr.android:report-sdk:+', { group: 'com.google.zxing', module: 'core' // exclude group: 'com.jiechic.library', module: 'xUtils' // exclude group: 'com.android.support', module: 'appcompat-v7' // exclude group: 'com.android.support', module: 'recyclerview-v7' }) // 根据需要加载对应的插件模块 exclude group:compile 'com.google.zxing', module:'core' }) compile(fr.android:location:+' // 定位插件,获取经纬度 compile 'com.fr.android:bi-sdkvpn:+', { // VPN插件,登录Sangfor VPN 服务器 exclude group:compile 'com.android.support', module: 'appcompat-v7'fr.android:gis:+' // GIS插件,显示GIS地图图表 excludecompile group: 'com.android.support', module: 'recyclerview' fr.android:push-xg:+' exclude group: 'com.google.zxing', module:'core' })// 推送插件, 集成信鸽推送服务 |
添加后,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文件,进行工程配置。各插件模块的使用,请参考相关插件文档。