1.创建app工程。
首先去官网下载一个环信demo,下载地址:https://github.com/easemob/kefu-android-demo
我们要使用它的聊天UI。kefu_easy_UI,下载之后直接把这个modle拷贝下来,放到app平级的目录。然后配置proj 的gradle文件,配置如下
// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.2.2' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files //添加内容 // classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1' classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6' } } // this script was used to upload files to bintray. //apply from: 'bintray.gradle' allprojects { repositories { jcenter() } } task clean(type: Delete) { delete rootProject.buildDir }
然后配置 setting.gradle文件,把这两个modle关联起来。我的项目配置如下
include ':app',':kefu-easeui' 配置app的gradle,配置如下dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') compile project(':kefu-easeui') //其他版本也可以 compile 'com.android.support:support-v4:23.1.1' },这样我们就可以调用easyui项目的东西了
这样,配置就算完成了。
有人想参考我的配置的话我上传了demo源码。拜拜
下载地址在我的csdn分享里面