十天冲刺(第一阶段)

今日份主要解决聊天过程中图片的传输我把他分成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);
    }

  

 

posted @ 2020-06-04 15:48  恶霸xx  阅读(117)  评论(0编辑  收藏  举报