- Home /
What's the best way to connect and communicate between an Android Unity app and a non-Unity Windows C++ application over LAN?
Hello,
I would appreciate any opinions about how best to accomplish the following. I want to a build an Android app in Unity that acts like a remote control for a non-Unity, non-.NET Windows C++ application. Spec would be the following:
Auto discovery and connect when both the Android and the Windows machine are connected to the same LAN (Wifi)
The Windows machine would be a server, app the client
Two way communication of events. Mostly button presses. Would need to be able serialize and send custom data.
The Windows application does video playback, so I would need to send play/pause, seek commands from the app as well as program title, current playback time, total running time etc. from the server.
I'm not very experienced w/ networking code. The best case scenario would be a common framework that has both a Unity store asset and a C++ dll that I could import on the Windows side that does the discovery, connection, and provides methods for two-way comms between the two (too much to ask??). I would like to avoid Internet-based cloud server solutions if possible. Hoping to avoid getting in the UDP trenches.
I have tried AllJoyn (Unity package found in version 14) and got a single button android app connecting to the PC application and working. The project discontinued Unity support in later versions and seems to have little activity these days. I have also looked into ZeroMQ, but haven't tried anything yet. Do you know another lib I should investigate? I have Unity pro and I'd happily buy an asset.
Any and all guidance very much appreciated, thank you.
Answer by Jordi-Bonastre · Aug 12, 2015 at 03:28 PM
I used ZeroMQ and it works fine between a C++ application and Unity.
In Unity I used clrzmq (http://zeromq.org/bindings:clr) and the standard ZeroMQ for C++ app.
Your answer
Follow this Question
Related Questions
Unity Editor cant host using systems.sockets.net sockets 0 Answers
Fast communication between Android and desktop via USB 0 Answers
Asynchronous socket hangs intermittently on iOS 1 Answer
Multiplayer game using Sockets or Socket.IO? (without UNET or Photon) 6 Answers
Similar networking options in unity? 2 Answers