Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Local iOS-Android zeroconf ad-hoc networking

The Desired Functionality:

User A is running your app on an Android or iOS device. User A can automatically find and communicate with other nearby (< 20 meters?) users B and C (Cross-Platform), whether they're running Android or iOS, and without any of the users having an internet connection (Offline).

I believe this is a commonly desired functionality, and having a definitive answer to this question would be a great boon to the mobile development community.

Further requirements/things you'd like to have, in order of importance:

  • Single Codebase (or at least sharing 90+% of code) for Android and iOS, e.g. through Xamarin or something similar.
  • Automatically choose the best (perhaps going down a list of preference) signal to use, e.g. choosing WiFi direct or bluetooth (similar to AllJoyn, Multipeer)
  • Use only Free (or free for certain classes of user) libraries

The Question:

How to achieve the desired functionality?

Sub-question 1

Is it even possible?

Answer: YES. Apps like Firechat and Spaceteam do it, therefore it must be possible.

Rejected Possibilities:

Multipeer: iOS only, doesn't achieve Cross-Platform.

Alljoyn: iOS bindings are Objective-C only, doesn't achieve Single Codebase.

Mono.Zeroconf: Supposedly would require separate platform implementations, so don't achieve Single Codebase?

Open Garden SDK: Would be a great solution, except it doesn't actually exist yet.

I've been researching this topic for several days now, and I haven't been able to find a definitive answer. Part of it is probably that people use so many different terms like mesh networking, ad-hoc networking, zeroconf, DNS-SD, etc., which makes it difficult to search.

If you're interested in some of the research I did on stackoverflow and elsewhere, here are some notes and links (I'm limited in the number of links I put directly in this post).

like image 921
stackedAE Avatar asked Jul 08 '14 03:07

stackedAE


1 Answers

Not sure if this is what you are looking for but I would highly recommend Xamarin with the library ZeroConf which is native and has Xamarin support.

https://github.com/onovotny/Zeroconf

It works great and that gets you close to your unified codebase with a native and uniform way of discovering other ZeroConf devices.

Edit: It looks like the ZeroConf library only supports subscribing to ZeroConf services and not publishing also and I think you will need publishing as well. But it seems other users have requested it so it seems like a feature they will be adding.

like image 188
Melloware Avatar answered Oct 03 '22 02:10

Melloware