本工程配置适用于IDEA和Android Studio两种Android集成开发环境,本文建议使用google官方的Android Studio作为你的开发工具
您可以从下载地址获取相关SDK
Android Studio 和 IDEA 配置方法相同,本文将以Android Studio为例,说明如何将FR SDK导入到您的项目中。
1. 下载libs文件夹
在SDK下载地址点击下载lib获取libs压缩包,并解压
2. 将解压后的libs文件夹中的完整内容复制到模块libs目录下
3. 打开该模块的build.gradle文件,并添加如下内容
repositories { maven { url uri("libs") // 配置该模块的maven仓库地址 } } |
compile 'com.fr.android:report-sdk:+' // 添加SDK report模块依赖 compile 'com.fr.android:bi-sdk:+' // 添加SDK bi模块依赖 //compile 'com.fr.android:core:+' // 添加SDK 核心模块依赖 //compile 'com.fr.android:platform:+' // 添加SDK 核心模块依赖 //compile 'com.fr.android:gis:+' // 添加SDK 地图模块依赖 //compile 'com.fr.android:location:+' // 添加SDK 定位模块依赖 //compile 'com.fr.android:vpn:+' // 添加SDK vpn模块依赖 //compile 'com.fr.android:push-xg:+' // 添加SDK 推送模块依赖 |
添加后,build.gradle如下所示
4. 在该模块清单文件的application标签中添加属性
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中相关依赖
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:+', { exclude group: 'com.android.support', module: 'appcompat-v7' exclude group: 'com.android.support', module: 'recyclerview' exclude group: 'com.google.zxing', module:'core' }) compile('com.fr.android:bi-sdk:+', { exclude group: 'com.android.support', module: 'appcompat-v7' exclude group: 'com.android.support', module: 'recyclerview' exclude group: 'com.google.zxing', module:'core' }) |
如上,工程配置完毕,FR SDK已经成功添加到您的项目中,之后可以直接引用FR相关的API,进行集成开发。您也可以参考OEM_demo和SDK_demo中的项目结构和build.gradle文件,进行工程配置。