准备 

开发工具

        本工程配置适用于IDEA和Android Studio两种Android集成开发环境,本文建议使用google官方的Android Studio作为你的开发工具

SDK下载

        您可以从下载地址获取相关SDK

导入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 fileTree(include: ['*.jar'], dir: 'libs')  // 依赖部分jar包文件
 
compile 'com.google.zxing:core:3.1.0'// 内部使用
compile 'com.jiechic.library:xUtils:2.6.14'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:recyclerview-v7:23.4.0'
   
compile ('com.fr.android:report-sdk:+', {// 添加SDK report模块依赖
    transitive = false
})
compile ('com.fr.android:bi-sdk:+', {// 添加SDK bi模块依赖
    transitive = false
})
compile ('com.fr.android:platform:+', { // 添加SDK 核心模块依赖
    transitive = false
})
compile ('com.fr.android:core:+', { // 添加SDK 核心模块依赖
    transitive = false  // 去除对应lib内部引用
})

compile ('com.fr.android:gis:+', {// 可选插件 地图模块依赖
    transitive = false
})
compile ('com.fr.android:location:+', {// 可选插件 定位模块依赖
    transitive = false
})
compile ('com.fr.android:vpn:+', {// 可选插件 vpn模块依赖
    transitive = false
})
compile ('com.fr.android:push-xg:+', {// 可选插件 信鸽推送模块依赖
    transitive = false
})

添加后,build.gradle如下所示

4. 在该模块清单文件的application标签中添加属性

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文件,进行工程配置。