powered by Jive Software

aSmack File Transfer Problem

Hi all.i want sending image in aSmack.I trying this code.

Bitmap bitmap = takeScreenshot();
String filePath = saveBitmap(bitmap);
FileTransferManager fileTransferManager = new FileTransferManager(LoginActivity.tcpConnection); try {
     fileTransfer(fileTransferManager,filePath,ustBirim+ "#"+ usid+"@"+ Listener.allUserDatas.get(usid.toUpperCase()).getDomainName()+ "/Atomic3.1");
} catch (XMPPException e) {
      // TODO Auto-generated catch block
     e.printStackTrace();
}

I trying this method;

public void fileTransfer(FileTransferManager manager, String fileName,String destination) throws XMPPException {
     FileTransferNegotiator.setServiceEnabled(LoginActivity.tcpConnection,true);
     OutgoingFileTransfer transfer = manager.createOutgoingFileTransfer(destination);
     transfer.sendFile(new File(fileName), "You won't believe this!");
     System.out.println(transfer.getStatus());
}

i check file.exits() method return true

transfer.getStatus() return Initial

transfer.getProgress() return 0.0

and i add while loop (!transfer.isDone()) but class not found Status.ERROR bla bla.

please help me