Asmack send file need fullJID,but I can't get It, how can i get fullJID

1.I had read https://www.igniterealtime.org/builds/smack/docs/latest/documentation/extensions /filetransfer.html

snippet code from this guide, it not need resource part

// Create the file transfer manager FileTransferManager manager = new FileTransferManager(connection); // Create the outgoing file transfer OutgoingFileTransfer transfer = **manager.createOutgoingFileTransfer("romeo@montague.net");** // Send the file transfer.sendFile(new File("shakespeare_complete_works.txt"), "You won't believe this!");

2.so I read spark source code org.jivesoftware.spark.PresenceManager find this method , so the documentation long time no to update;

/**

*/

public static String getFullyQualifiedJID(String jid) {

System.out.println("getFullyQualifiedJID : " + jid);

final Roster roster = SparkManager.getConnection().getRoster();

Presence presence = roster.getPresence(jid);

System.out.println("getFullyQualifiedJID : " + presence.getFrom());

return presence.getFrom();

}

  1. I find this method not work for asmack , so google it found this

xmpp - Smack’s FileTransferManager.createOutgoingFileTransfer only accepts full JIDs. How can I determine the full JID o…

snippet code from my project

Roster roster = connection.getRoster();

List presenceList = roster.getPresences(jid);

Log.d(TAG, "bareJid : " + jid);

for (Presence presence : presenceList) {

Log.d(TAG, "fullJID : " + presence.getFrom());

}

why the code can not get the fullJID.

the output:

12-23 06:55:35.840: D/MChat(1805): bareJid : test@tigereye-pc

12-23 06:55:35.840: D/MChat(1805): fullJID : test@tigereye-pc

4.the result is the same, so how can I get the fullJID

Thanks & Regards

I think you can try to add this:

String connectedUserName = connection.getUser();

and Log the connectedUserName. I’m not sure if this is complete one or not