Android使用EaseUI集成环信3.0

集成环信看了很多文档,还是不会,从官网下载的demo,也不会用,后来才发现应该下载官网的sdk,里面有个examples的文件夹,使用studio直接打开里面的ChatDemoUI3.0,就是一个可以运行的demo.运行的时候会报一个异常Error:Execution failed for task ':transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/multidex/MultiDex$V14.class

ChatDemoUI3.0的build文件有个依赖v7包的,我对照以前可以运行的项目发现,删除v7 的这一行,就可以了,可以运行起来.下面的集成大部分是仿照demo做的.

(原来只要删除这个v7包就能运行起来,其他的都不需要)

dependencies {
    compile project(':redpacketlibrary')
    compile project(':EaseUI')
    compile fileTree(include: '*.jar', exclude: 'android-support-multidex.jar', dir: 'libs')
    //考虑到在eclipse中,直接使用源码
    //    compile ('com.anthonycr.grant:permissions:1.0'){
    //        exclude module: 'support-v4'
    //    }
    compile 'com.android.support:appcompat-v7:23.4.0'
}

首先在环信官网下载sdk

解压后examples内的easeUI依赖到项目中,(easeUi包含simpledemo如果不需要可以删除)

根据examples内的ChatDemoUi将需要的文件考到自己的项目中

记得改清单文件的appkey以及ParseManager的parseAppId和ParseClientKey

第一步:ChatFragment

@Override
public void onSetMessageAttributes(EMMessage message) {
    //设置消息扩展属性
    message.setAttribute("name", MyApplication.myPreferences.getNickname());
  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值