简体   繁体   中英

Sending a String array through a tigase server from one Android to another using XMPP protocol

I'm currently trying to use the Smack libraries and the Tigase server to send a String array from one Android to another using the XMPP protocol (I'm developing in Java with the Eclipse IDE).

Is the String array an Item? or something else? I might be able to also send it as a file but I think it might be more energy consuming (for the device's battery).

Is there a preferable way to accomplish this task?

I cannot help you with Smack library, however why don't you use Tigase's JaXMPP2 instead? https://projects.tigase.org/projects/jaxmpp2 This is Java library which has been created specifically to be compatible with Android, GWT and standalone Java applications. So kind of portable Java library. This way all the software you use comes from one vendor and I am sure in such a case nice guys from Tigase would be happy to help you out.

This is pretty simple to do.

The simplest approach would be to simply create a chat between the two users and send the data as the message body. Since your content is just a string array it can be easily sent as a comma delimited list of strings that you can easily marshall/unmarshall at each end.

The fact that you are using tigase is irrelevant in this case as it is basic XMPP and will work with any server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM