asmack不在android中共享大文件

时间:2014-06-05 14:09:12

标签: android xmpp asmack

我正在使用以下方法在Android中实现XMPP客户端应用程序以进行文件共享:

  1. asmack-android-19-0.8.10.jar
  2. FileTransferNegotiator.IBB_ONLY = true;发送和接收。
  3. 我的代码是正确发送/接收图像和小型音频/视频(1mb以下), 但是对于大图像正在处理,并且在最后一次显示错误并且所有文件都没有接收。

    请有人可以帮忙吗?

    06-06 13:32:09.370: D/SMACK(19331): 01:32:09 PM SENT (1096333592): 
    <iq id="n1K2O-178" to="newchat@appazineapp.com/Smack" type="set">
        <data
            xmlns="http://jabber.org/protocol/ibb" seq="165" sid="jsi_6939764179431327669">Tt5G7Pgf2PvVYHEMtzgHaIDP1VeE7.........
    06-06 13:32:10.480: D/SMACK(19331): 01:32:10 PM RCV  (1096333592): 
            <iq id="n1K2O-177" to="admin@appazineapp.com/Smack" from="newchat@appazineapp.com/Smack" type="result"/>
    06-06 13:32:11.300: D/SMACK(19331): 01:32:11 PM RCV  (1096333592): 
            <iq id="n1K2O-178" to="admin@appazineapp.com/Smack" from="newchat@appazineapp.com/Smack" type="error">
                <data
                    xmlns="http://jabber.org/protocol/ibb" seq="165" sid="jsi_6939764179431327669">Tt5G7Pgf2PvVYHEMtzgHaIDP1VeE7jNNvnhIKVu/o6JXl8dpM9GHHEy+UBs8lk0QLTrxmZAoPW7eoEd........
                </data>
                <error code="400" type="WAIT">
                    <unexpected-request
                        xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
                    </error>
                </iq>
    
        05-28 20:38:58.011: W/System.err(4044): java.lang.IllegalArgumentException: IQ must be of type 'set' or 'get'. Original IQ: 
    <iq id="4flBi-289" to="newchat@appazineapp.com/Smack" from="admin@appazineapp.com/Smack" type="error">
        <data
            xmlns="http://jabber.org/protocol/ibb" seq="275" sid="jsi_6594777956963977527">Y0oP6SaIJPaqRXq1X3Ck8nvfF8LiaNno.......
        05-28 20:38:58.021: W/System.err(4044):     at org.jivesoftware.smack.packet.IQ.createResultIQ(IQ.java:137)
        05-28 20:38:58.021: W/System.err(4044):     at org.jivesoftware.smackx.bytestreams.ibb.InBandBytestreamSession$IQIBBInputStream$1.processPacket(InBandBytestreamSession.java:473)
        05-28 20:38:58.031: W/System.err(4044):     at org.jivesoftware.smack.Connection$ListenerWrapper.notifyListener(Connection.java:867)
        05-28 20:38:58.031: W/System.err(4044):     at org.jivesoftware.smack.PacketReader$ListenerNotification.run(PacketReader.java:455)
        05-28 20:38:58.031: W/System.err(4044):     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)
        05-28 20:38:58.031: W/System.err(4044):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
        05-28 20:38:58.031: W/System.err(4044):     at java.util.concurrent.FutureTask.run(FutureTask.java:137)
        05-28 20:38:58.041: W/System.err(4044):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
        05-28 20:38:58.041: W/System.err(4044):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
        05-28 20:38:58.041: W/System.err(4044):     at java.lang.Thread.run(Thread.java:856)
    

1 个答案:

答案 0 :(得分:0)

除了使用openfire上传图像,您还可以创建一个java插件,可以在服务器上传文件,然后就像whatsapp使用的那样向朋友发送绝对路径。

我也会尽快发布整体代码。 希望这有效!