easemob / sdkdemoapp3.0_android Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
自己踩过的坑,方便后人。即使把easesdk和easeui都从git上拉下来,并且把分支都切换到sdk3.0,或者都切换到release,build的时候依然会报default的问题。想快速使用example的朋友去使用吧:http://downloads.easemob.com/downloads/easemob-sdk-3.1.5.zip
解压后有个examples目录,可以正常使用
redpacket红包的支付方式多些选择, 银行卡,微信,支付宝都一起一个sdk啥时候弄好..
就像访qq pad 版本的 左右分屏的,我想做 pad 版本的app
在htc手机上点击视频录制一直报start failed: -2147483648这个错,还望修复
视频通话怎么才能显示昵称而不是id
设置用户信息需要打开聊天页面才能回调,但是项目只有视频通话功能,需要怎么设置昵称?
release包开启混淆发送图片会使App崩溃,发文本消息正常!
希望能通过studio一步引用功能和布局的库,类似这样的引用compile 'com.ogaclejapan.smarttablayout:library:1.4.2@aar'
谢谢。
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference
at android.preference.PreferenceManager.getDefaultSharedPreferencesName(PreferenceManager.java:383)
at android.preference.PreferenceManager.getDefaultSharedPreferences(PreferenceManager.java:378)
# at com.hyphenate.chat.EMSessionManager.getLastLoginUser(Unknown Source)
at com.hyphenate.chat.EMClient.init(Unknown Source)
at com.hyphenate.chat.ChatClient.init(ChatClient.java:147)
测试步骤:
问题原因
主页被系统回收,系统每次尝试恢复主页时,MainActivity的onCreate()就会被回调,代码
getSupportFragmentManager().beginTransaction().add(R.id.fragment_container, conversationListFragment)
.add(R.id.fragment_container, contactListFragment).hide(contactListFragment).show(conversationListFragment)
.commit();
就会add新的ConversationListFragment,ContactListFragment对象,而以前add的三个fragment并没有被remove掉,所以MainActivity就会加载多个ConversationListFragment,ContactListFragment,SettingsFragment。
解决方法
当系统尝试恢复页面时,让MainActivity通过三个Fragment实例的tag来重新find到已经实例化的fragment,oncreate()修正的代码如下:
···
//umeng api
MobclickAgent.updateOnlineConfig(this);
UmengUpdateAgent.setUpdateOnlyWifi(false);
UmengUpdateAgent.update(this);
if (getIntent().getBooleanExtra(Constant.ACCOUNT_CONFLICT, false) && !isConflictDialogShow) {
showConflictDialog();
} else if (getIntent().getBooleanExtra(Constant.ACCOUNT_REMOVED, false) && !isAccountRemovedDialogShow) {
showAccountRemovedDialog();
}
inviteMessgeDao = new InviteMessgeDao(this);
userDao = new UserDao(this);
fragments = new Fragment[3];
if (savedInstanceState == null) {
conversationListFragment = new ConversationListFragment();
contactListFragment = new ContactListFragment();
settingFragment = new SettingsFragment();
getSupportFragmentManager().beginTransaction().add(R.id.fragment_container, conversationListFragment, "switcher:" + 0)
.add(R.id.fragment_container, contactListFragment, "switcher:" + 1).hide(contactListFragment).show(conversationListFragment)
.commit();
} else {
conversationListFragment = (ConversationListFragment) getSupportFragmentManager().findFragmentByTag("switcher:" + 0);
contactListFragment = (ContactListFragment) getSupportFragmentManager().findFragmentByTag("switcher:" + 1);
settingFragment = (SettingsFragment) getSupportFragmentManager().findFragmentByTag("switcher:" + 2);
if (conversationListFragment == null) {
conversationListFragment = new ConversationListFragment();
getSupportFragmentManager().beginTransaction().add(R.id.fragment_container, conversationListFragment, "switcher:" + 0);
}
if (contactListFragment == null) {
contactListFragment = new ContactListFragment();
getSupportFragmentManager().beginTransaction().add(R.id.fragment_container, contactListFragment, "switcher:" + 1);
}
if (settingFragment == null) {
settingFragment = new SettingsFragment();
getSupportFragmentManager().beginTransaction().hide(contactListFragment).show(conversationListFragment)
.commit();
} else {
getSupportFragmentManager().beginTransaction().hide(contactListFragment).hide(settingFragment).show(conversationListFragment)
.commit();
}
}
fragments[0] = conversationListFragment;
fragments[1] = contactListFragment;
fragments[2] = settingFragment;
//注册local广播接收者,用于接收demohelper中发出的群组联系人的变动通知
registerBroadcastReceiver();
EMClient.getInstance().contactManager().setContactListener(new MyContactListener());
//内部测试方法,请忽略
registerInternalDebugReceiver();
EMLog.d(TAG, "width:" + getScreenWidth(this) + " height:" + getScreenHeight(this));
···
onTabClicked(View view)方法修正如下:
···
if (currentTabIndex != index) {
FragmentTransaction trx = getSupportFragmentManager().beginTransaction();
trx.hide(fragments[currentTabIndex]);
if (!fragments[index].isAdded()) {
trx.add(R.id.fragment_container, fragments[index], "switcher:" + index);
}
trx.show(fragments[index]).commit();
}
···
over
java.lang.RuntimeException:Unable to start receiver .ease.receiver.StartServiceReceiver: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=com.hyphenate.chat.EMChatService (has extras) }: app is in background uid UidRecord{604ec63 u0a185 SVC idle procs:2 proclist:16170,16244, seq(0,0,0)}
可以直接把这个StartServiceReceiver 给去掉吗?
如果是这样,为什么啊?
java.lang.UnsatisfiedLinkError: dlopen failed: /data/app/com.xxx.xxx-1/lib/arm/libhyphenate_av.so: has text relocations
at java.lang.Runtime.loadLibrary(Runtime.java:372)
at java.lang.System.loadLibrary(System.java:1076)
at com.hyphenate.chat.EMClient.loadLibrary(Unknown Source)
at com.hyphenate.chat.EMClient.getInstance(Unknown Source)
官网下的jar包是hyphenatechat——3.1.2.jar里的是 com.hyphenate.chat.EMChatManager 没有EMChatManager.getInstance()这个方法。。。这该怎么办?
app/build.gradle
里包含 implementation project(':easeui')
但是项目里却没有easeui
, 总不能还要单独去另一个仓库下载?
多人视频会议声音很渣,如果靠得很近声音会很刺耳?
EMClient.getInstance().logout(true, new EMCallBack() {
@Override
public void onSuccess() {
Log.e("111","退出成功");
runOnUiThread(new Runnable() {
@Override
public void run() {
String currentUser = EMClient.getInstance().getCurrentUser();
Log.e("222","currentUser:"+ currentUser);
}
});
}
@Override
public void onProgress(int progress, String status) {
}
@Override
public void onError(int code, String message) {
LogUtils.e("退出失败");
}
});
导入项目提示:Error:Configuration with name 'default' not found.
注册时出现错误:code : 208 ,description : Registration failed.
注册代码写在IO线程中
GlobalScope.launch(Dispatchers.Main) {
try {
withContext(Dispatchers.IO) {
LogUtils.d("当前线程: ${Thread.currentThread().name} ")
EMUtils.getInstance().createAccount(userName, passWord)
}
......
} catch (e: HyphenateException) {
LogUtils.e("code : ${e.errorCode} ,description : ${e.description}")
val errorCode = e.errorCode
if (errorCode == EMError.NETWORK_ERROR) {//网络异常
showToastMessage(getString(R.string.network_isnot_available))
} else if (errorCode == EMError.USER_ALREADY_EXIST) {//用户已经存在
showToastMessage(getString(R.string.User_already_exists))
} else if (errorCode == EMError.USER_AUTHENTICATION_FAILED) {//无权限
showToastMessage(getString(R.string.registration_failed_without_permission))
} else if (errorCode == EMError.USER_ILLEGAL_ARGUMENT) {//用户名不合法
showToastMessage(getString(R.string.illegal_user_name))
} else if (errorCode == EMError.EXCEED_SERVICE_LIMIT) {//App用户注册数量已达上限
showToastMessage(getString(R.string.register_exceed_service_limit))
} else {//注册失败
showToastMessage(getString(R.string.Registration_failed))
}
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.