9

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).

Community
  • 1
  • 1
stackedAE
  • 303
  • 1
  • 12
  • If you really want single codebase you can use Alljoyn with Unity. – ThomasW Jan 22 '15 at 07:55
  • I just tried a brief test with Firechat and it looks like it doesn't send messages between iOS and Android devices unless they are both connected to a wifi or cellular network. That is, the two devices don't connect directly. However, this was a quick and dirty test. I like to see if other people have the same experience. – ThomasW Jan 22 '15 at 07:57
  • Any updates on this? Really interested in a solution. – captainrad Mar 25 '16 at 02:01
  • I was never able to find a solution to this, unfortunately. – stackedAE Apr 21 '17 at 23:17

1 Answers1

1

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.

Melloware
  • 10,435
  • 2
  • 32
  • 62