Android File Transfer not working via XMPP and OpenFire

老子叫甜甜 提交于 2019-12-03 03:13:16

Use

transfer.receiveFile(myLocalFile);

instead of

InputStream stream = transfer.receive();

You are blocking the PacketReader thread. The first method will spawn it's own thread to read the specific packets that make up the parts of the file being transferred. If you use the second method you have to spawn a thread of your own to do the actual file reading and writing.

I have created a simple program of Java , with some copy_paste of other users code , but the +point is that it is working , i have tried this b/w LocalHost - SPark client - javaProgram

you can send txt.file to other user , created in openFile User Section .

Note : please change any thing if you want any details in Xmpp.test class .

Download Xmpp File Transfer "Java Code" From Here

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!