Android Question Share file using wifi

microbox

Active Member
Licensed User
Longtime User
Hello everyone, I need the simplicity of MQTT for a chat app. But I also I need the option to be able send file to a specific user online. Can you give an idea what is the best way to achieve this? I have tried using the example (Network + AsyncStreams + B4XSerializator) transferring file is working but I 'm having trouble reconnecting to other user(max 5) to send message.(always disconnecting). I appreciate any help.
 

DonManfred

Expert
Licensed User
Longtime User
Why not just use MQTT and send the file over it?

If too big then you need to build a solution to send and receive files in parts.
 
Upvote 0

microbox

Active Member
Licensed User
Longtime User
Why not just use MQTT and send the file over it?

If too big then you need to build a solution to send and receive files in parts.
Hello DonManfred...thank you for answering. The file is less than 4mb, is it the similar to Network + AsyncStreams + B4XSerializator? Can you please give a link/snippet incorporating MQTT?
 
Upvote 0

microbox

Active Member
Licensed User
Longtime User
No. I do NOT see any problem here too.
Convert the file to a bytearray and send this bytearray. As far as i know MQTT is able to have binary payload.
What about writing 5 Lines of code by yourself?
okay thanks for the tip. I will try it.
 
Upvote 0
Top