यह त्रुटि लॉग में आती है।एंड्रॉइड ऐप्स में स्मैक का उपयोग करके फ़ाइल स्थानांतरण।
from='[email protected]/Smack' to='[email protected]/Smack' type='error' id='hK1L6-5'>
<si xmlns='http://jabber.org/protocol/si' id='jsi_191216212994140179' mime-type='image/png' profile='http://jabber.org/protocol/si/profile/file-transfer'>
<file xmlns='http://jabber.org/protocol/si/profile/file-transfer' name='this_old_house.png' size='12623'>
<desc>You won't believe this!</desc></file>
<feature xmlns='http://jabber.org/protocol/feature-neg'>
<x xmlns='jabber:x:data' type='form'><field var='stream-method' type='list-multi'>
<option><value>http://jabber.org/protocol/bytestreams</value></option>
<option><value>http://jabber.org/protocol/ibb</value></option>
</field>
</x>
</feature>
</si>
<error code='503' type='cancel'>
<service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
</error></iq>
मैं
ServiceDiscoveryManager sdm = ServiceDiscoveryManager.getInstanceFor(Main.connection);
if (sdm == null)
sdm = new ServiceDiscoveryManager(Main.connection);
sdm.addFeature("http://jabber.org/protocol/disco#info");
sdm.addFeature("jabber:iq:privacy");
FileTransferNegotiator.setServiceEnabled(Main.connection, true);
FileTransferManager manager = new FileTransferManager(Main.connection);
OutgoingFileTransfer transfer = manager.createOutgoingFileTransfer(id
+ "/Smack");
Log.i("transfere file", "outgoingfiletransfere is created");
try{
//OutgoingFileTransfer.setResponseTimeout(60000);
transfer.sendFile(new File(txt_file.getText().toString()), "You won't believe this!");
if (transfer.getStatus().equals(Status.cancelled)
|| transfer.getStatus().equals(Status.refused)) {
Log.d("Cancel", ""+transfer.getError());
System.out.println("Cancelled!!! " + transfer.getError());
}
Log.i("transfere file", "sending file");
Log.d("FTTRY", "m in ft TRY");
btn_transfer.setText("Browse");
txt_file.setText("click on browse n Select File");
send_flag = true;
}catch (Exception e) {
Log.d("FTCATCH", "m in ft catch");
btn_transfer.setText("BrowseC");
send_flag = true;
}
while(!transfer.isDone()) {
try{
Thread.sleep(1000);
}catch (Exception e) {
}
Log.i("transfere file", "sending file status "
+ transfer.getStatus() + "progress: "
+ transfer.getProgress());
if(transfer.getStatus().equals(Status.error)) {
System.out.println("ERROR!!! " + transfer.getError());
} else {
System.out.println(transfer.getStatus());
System.out.println(transfer.getProgress());
Log.d("PROG", "m in ft progress");
}
try{
Thread.sleep(1000);
}catch (Exception e) {
}
}
क्या आप स्मैक का संस्करण उपयोग कर रहे हैं? – Hussain
asmack15 मैं 5 दिनों से कोशिश करता हूं लेकिन फिर भी मैं स्मैक के माध्यम से फ़ाइल स्थानांतरित करने के लिए सक्षम नहीं हूं। यदि आपको इसके बारे में कोई विचार है तो कृपया – Kutbi
@ हुसैन की सहायता करें मैंने स्मैक के इस संस्करण का उपयोग किया है: -asmैक-android-7-beem.jar –