今日份主要解决聊天过程中图片的传输我把他分成64进制的base64然后存入数据库然后有让另一方下载这个图片
问题就是效率太低了图片加载太慢了
ImageMessage imageMessage = (ImageMessage) message.getContent(); String url = imageMessage.getRemoteUri().toString(); if (!TextUtils.isEmpty(url)) { LogUtils.i("url:" + url); MessageEvent event = new MessageEvent(EventManager.FLAG_SEND_IMAGE); event.setImgUrl(url); event.setUserId(message.getSenderUserId()); EventManager.post(event); // pushSystem(message.getSenderUserId(), 1, 0, 0, getString(R.string.text_chat_record_img));
public void sendImageMessage(String targetId, File file) { ImageMessage imageMessage = ImageMessage.obtain(Uri.fromFile(file), Uri.fromFile(file), true); RongIMClient.getInstance().sendImageMessage( Conversation.ConversationType.PRIVATE, targetId, imageMessage, null, null, sendImageMessageCallback); }