Quantcast
Channel: Ignite Realtime : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 10742

aSmack File Transfer Problem

$
0
0

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;

publicvoid 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


Viewing all articles
Browse latest Browse all 10742

Trending Articles