Search code examples
androidiosbluetoothnfcbonjour

Does Apple's Bonjour protocol work over cellular connections?


So here are the questions:

  1. Does Apple's Bonjour even work over cellular (3G, 4G, LTE)?
  2. If so, how local is the discovery? Discover all in the same cell tower? Same provider? The entire internet?

Also, just as a small side note, is there any Bonjour support on Android (libraries, OS, etc.).

Note: I'm really looking for a way to do local discovery, but iOS doesn't have a public Bluetooth API that could work with some droids (please correct me if I'm wrong, I really hope I am). I also read about Bonjour over Bluetooth, but I couldn't find any resources about it. Also, would NFC be an option?


Solution

  • To answer your first two questions:

    1. No; in theory, other subscribers on the same subnet could see each others' services, but AFAIK there's no provision for sending multicast packets over cellular networks. Even if there were, network providers would likely filter it to reduce bandwidth usage.

    2. A Bonjour service is generally visible to any other device on the same link-local network, i.e. the same subnet, assuming that the router doesn't filter multicast packets. Most domestic routers relay them, but some large [e.g. college & corporate] networks drop them, again to reduce demand for bandwidth.

    You can use jMDNS to do Bonjour service advertising/discovery with Android, it's pretty mature (or you can even roll your own, it's not that difficult :)

    As for Bluetooth and NFC, I'm not sure; it sounds like you'll need to administer some single point of registration/coordination for whatever service you're advertising/consuming.