Thanks! Can I ask one more thing, is with this frameworks possible to make app for macOS that will communicate with Android (in both directions)? If Android can implement Bonjour to your app, and as I read they can.
Post
Replies
Boosts
Views
Activity
We implement Bonjour in Android and macOS see Android device via Bonjour. But how now connect these two device and that they communicate?
How to print the connection port in the console when the app running without going in debugging?
connection?.currentPath?.localEndpoint this only work in debug when hit breakpont.
Thanks
We're doing an app where Android and Mac send messages between each other. So far we managed to handle Android <-> Android, iOS <-> iOS and MacOS <-> iOS. We used Bonjour (NSD in Android) for discovery. When it comes to Android <-> iOS/Mac, they discover each other fine but the connecting is problematic.
On Android's end, to start we used Google's old nsdChat, converted to Kotlin and added coroutines to free up the main thread. On the Mac, we used Apple's Peer-to-Peer sample project of TicTacToe. Like I said, both apps work fine on their own OS.
Doing Android<->iOS/MacOS, after we register Android's service, Bonjour on Mac recognizes it. Android discovers the Mac too and resolves the service. After connecting, Android says it connected a client socket and manages to send a message before getting a random symbol back from Mac's side although no one sends it, before closing the connection. On the other side, when you click on Android's "Connect", Mac doesnt immediately shows any signs that they connected, but when you send the message from Android it shows some errors. (so there was something between them)
We're inexperienced in the Networking part, but we suspect it has something to do with the protocols, as it mentions SSL and TLS. Not sure if we have to do some extra modifications to it to work. Is it as simple as adding a SSL socket to Android and that that would fix the connection? There are practically no examples online, and literature is pretty scarce (all are mostly decidated to their own OS's, without cross functionality). I can expand more (add our code, explain further etc.) if there is someone who knows what's wrong/missing.
Yes, without TLS we have a connection but some strange messages appear when we send from Android -> iOS, and also iOS -> Android. We try with TLC options with a pre-shared key but then fail to connect.