【仅供内部供应商使用,不提供对外解答和培训】

Page tree

【仅供内部供应商使用,不提供对外解答和培训】

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 13 Next »

准备 

开发工具

        本工程配置适用于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文件,并添加如下内容

设置该模块maven仓库地址
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. 项目本身需要做的工程引用. 其中core. platform为核心模块,  bi report为顶层模块.  vpn location xg push为可选模块.

添加该模块依赖包
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 fileTree(include: ['*.jar'], dir: 'libs')

compile ('com.fr.android:report-sdk:+', {// 报表功能对应模块.
    transitive = false
})
compile ('com.fr.android:bi-sdk:+', {// BI功能对应模块.
    transitive = false
})
compile ('com.fr.android:platform:+', {// 核心功能 框架
    transitive = false
})
compile ('com.fr.android:core:+', { // 核心模块.
    transitive = false  // 去除对应lib内部引用
})

compile ('com.fr.android:gis:+', {// 可选插件 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
})


如上,工程配置完毕,FR SDK已经成功添加到您的项目中,之后可以直接引用FR相关的API,进行集成开发。您也可以参考OEM_demo和SDK_demo中的项目结构和build.gradle文件,进行工程配置。

  • No labels