Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Peer to Peer communication between iOS and Android devices

So I am a relatively new iOS developer but thanks to Stackoverflow, i managed to get peer to peer data communication for my app working without the need of a server using gamekit/GKSessions. Basically, one iOS device acts as a server and others just connect to it to receive app specific data.

Now, the app is currently being ported on Android and I was wondering if there is a way that I can make an Android device connect to the iOS app and behave the same way as ios app does. Android developers suggested alljoyn to be an optimum solution for android but that doesn't seem to be available yet for iOS.

Please suggest if you have any ideas on this front. If there is a solution that involves rework on iOS side as well then I am open to it!

like image 225
Venkat Avatar asked Jul 09 '12 19:07

Venkat


3 Answers

In case, you or others tackling the same question in Jan 2013 needs an answer, AllJoyn is now ready for iOS too, amongst other platforms.

https://www.alljoyn.org/docs-and-downloads

like image 116
S G Avatar answered Oct 15 '22 05:10

S G


Venkat i suggest you to read and get some detailed information regarding P2P. This is a Good source, because you might get stuck if both devices are behind multiple Nat. but if your willing to go forward there is always a way. My suggestion would be an Relay, but you need to have a server, but the relay behaves like P2P. Look at the source above to get ideas.

like image 27
Navin Avatar answered Oct 15 '22 04:10

Navin


I didn't have time to wait for alljoyn to be launched for iOS and sensing no other feasible solution that would fit on my timeline, I implemented a relay server in between to achieve this.

For others though, iOS binding is now available for alljoyn (www.alljoyn.org). I haven't tried it yet but the android version of my app works with alljoyn and it works perfectly so I assume it will do the same for iOS as well.

One limitation to be considered using alljoyn is that it cannot communicate between devices that are behind different subnets.

like image 27
Venkat Avatar answered Oct 15 '22 05:10

Venkat