Note that there are some explanatory texts on larger screens.

plurals
  1. POFile transfer in Android using xmpp
    text
    copied!<p>I am working on file transfer using xmpp. This is my code of file transfer.</p> <pre><code> ServiceDiscoveryManager sdm = ServiceDiscoveryManager.getInstanceFor(connection); if (sdm == null) sdm = new ServiceDiscoveryManager(connection); FileTransferManager manager = new FileTransferManager(connection); OutgoingFileTransfer transfer = manager.createOutgoingFileTransfer("user@myHost/Smack"); File file = new File(filenameWithPath); try { transfer.sendFile(file, "You won't believe this!"); } catch (XMPPException e) { e.printStackTrace(); } while (!transfer.isDone()) { Log.i("progres", "" + transfer.getProgress()); } if (transfer.getStatus().equals(Status.refused)|| transfer.getStatus().equals(Status.error) || transfer.getStatus().equals(Status.cancelled)) { System.out.println("refused cancelled error " + transfer.getError()); } else { System.out.println("Success"); } </code></pre> <p>The problem is that It crash when other side when accept the file.</p> <p>Log file:</p> <pre><code>FATAL EXCEPTION: File Transfer jsi_1117022495316866568 java.lang.ClassCastException: org.jivesoftware.smack.util.PacketParserUtils$2 at org.jivesoftware.smackx.filetransfer.FileTransferNegotiator.negotiateOutgoingTransfer(FileTransferNegotiator.java:401) at org.jivesoftware.smackx.filetransfer.OutgoingFileTransfer.negotiateStream(OutgoingFileTransfer.java:359) at org.jivesoftware.smackx.filetransfer.OutgoingFileTransfer.access$100(OutgoingFileTransfer.java:35) at org.jivesoftware.smackx.filetransfer.OutgoingFileTransfer$2.run(OutgoingFileTransfer.java:214) at java.lang.Thread.run(Thread.java:1019) </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload