xmppserverchatejabberdsmack

How to send media content in chat application?


I am designing a Android chat application using ejabberd as XMPP server and Smack 4.1 API.

My requirement is to send inline images, maps and videos in chat windows. I realized that, sending media content through XMPP Server(ejabberd) is not a good idea when it comes to performance.

I need experts suggestions on how should i proceed with sending inline media content in chat window?

Thanks in advance.


Solution

  • Create api that will upload the media data (http post call) using multipart service. on the responce of the service get the url (get http service) and send the url as xmpp message.

    <message
        from='user1@hostName'
        id='richard2-4.1.247'
        to='user2@hostName'>
      <body>Sent a Image</body>
      <url>media url</url>
      <thumb> Base 64 </thumb>
    </message>
    

    when user2 receive the message you can call service to get the media data