This error come in log.
from='kutbi1@360degree/Smack' to='akash@360degree/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>
I have use following code here
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) {
}
}