3

I have a Bonjour service running on my MacBook Pro on my local network that I am trying to detect in a client app on an Android device (Galaxy Nexus).

I have implemented Bonjour service discovery two ways. The first is via Android's NSD package, which is detailed here. I have implemented the code they suggest in the section "Discover Services on the Network". It discovers my service just fine, but there is no API call to access the txt records for that service, which I need access to so I can build the URL to hit for the service, making this method kind of a deal-breaker until I can access that.

That prompted me to try the other method of Bonjour service discovery detailed here in the "Discover Nearby Services" section, since they have an API for txt record discovery. I know the service discovery starts, because it's not logging any errors, but this method does not discover any Bonjour services for me, not even all the ones Apple has on their MacBooks by default. It's implemented exactly as it is on their website, so what do I need to do to make this work? Does my MacBook need to run something in addition to the Bonjour service so that it is recognized as a WiFi-Direct device? Or is this just not possible using Android's API with this set up, and should I be looking to libraries like JmDNS to do what I need until Android's API is more complete/documented?

There seems to be very little documentation, aside from what Android provides (which isn't super thorough), for these new Nsd APIs, so if anyone else has dived into this and can give more guidance, it would be greatly appreciated!

Big-O Claire
  • 956
  • 8
  • 13

1 Answers1

0

This is probably dependent on the service implementation that MacBook Pro offers.

"I have a Bonjour service running on my MacBook Pro on my local network" - If you are using NSD with WI-FI direct I believe it will not try look for services running in your local network rather it will look for services running in nearby devices via WI-FI direct and no connection.

"However, using Wi-Fi Direct Service Discovery allows you to discover the services of nearby devices directly, without being connected to a network".

I think this means a separate implementation might be required by your MacBook Pro to help WI-FI direct communication, so that it can respond to discovery requests not in the local network. Sorry I cannot say more than this at the moment.

ZakiMak
  • 2,072
  • 2
  • 17
  • 26
  • That is kind of what I figured. I jumped the Android NSD ship and started implementing JmDNS ages ago, and things have been going much more smoothly :) – Big-O Claire Jul 29 '13 at 16:19
  • Are you able to get the TXT record by NSD APIs or your own implementation similar to JmDNS? Thanks – Snekithan Feb 27 '14 at 22:06