简体   繁体   中英

Android network messaging framework?

So this is kind of a complex problem. I am developing an application that needs to be able to get data over the network. I want to be able to send a string from my computer running an application to an android application. Like if I want to tell the android application "HELLO", then it would discover the android app on the network, and send the string "HELLO" to the android application. I need to be able to send from iOS, MacOSX, Windows, and so on. The application would most likely be written in java for the desktop version, and iOS version would need to be in cocca, of course, but if that doesn't work, then so be it. Is there anything like that out there

I would look into mDNS. OS X/iOS's implementation is called Bonjour and they have an API for it. There is a library for Java/Android called JmDNS. It'll only work on a LAN, but with it you can advertise/discover who is on your network. For example, you can have the Android app advertise that it is running and your phone has IP address X. Then your desktop app can discover that and open a new data connection to address X.

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