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

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 18 Current »

准备 

开发工具

        本工程配置适用于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 fileTree(include: ['*.jar'], dir: 'libs')  // 依赖部分jar包文件

    compile ('com.fr.android:bi-sdk:+', {// BI功能对应模块.

        //  可能的冲突版本 需要排除
//        exclude 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'

    })
    compile('com.fr.android:report-sdk:+', {// 报表对应模块.

        //  可能的冲突版本 需要排除
//        exclude 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'
    })
	// 根据需要加载对应的插件模块
    compile 'com.fr.android:location:+'     // 定位插件,获取经纬度
    compile 'com.fr.android:vpn:+'          // VPN插件,登录Sangfor VPN 服务器
    compile 'com.fr.android:gis:+'          // GIS插件,显示GIS地图图表
    compile 'com.fr.android:push-xg:+'      // 推送插件, 集成信鸽推送服务

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

  • No labels