2

I am using the Android NDK, with dns_sd.h code that works fine on other platforms: https://github.com/HBPVIS/Servus/blob/master/servus/dnssd/servus.h

On Android, the library is calling DNSServiceRegister, there is no error return code, but a DNS-SD inspection tool (avahi-discover) shows me that there is nothing announced in the network.

I enabled the following permissions:

ACCESS_NETWORK_STATE
CHANGE_WIFI_MULTICAST_STATE
ACCESS_WIFI_STATE

I link against Android's mDNSResponder implementation, and link against the shim library as recommended in this answer.

Community
  • 1
  • 1
Jean-Michaël Celerier
  • 7,412
  • 3
  • 54
  • 75
  • You can call [NSD API](https://developer.android.com/reference/android/net/nsd/package-summary.html) to do this if your Android version >= Jelly Bean. It's easy to use though it's buggy. – jfly May 16 '17 at 01:49
  • I'd rather have no Java code at all in my app (I currently don't). – Jean-Michaël Celerier May 16 '17 at 07:12
  • Same taste with me, just too tired:) – jfly May 16 '17 at 09:15
  • I have the same issue...some recommend to acquire a multicast lock (wifi.createMulticastLock) but that didn't work either. – mike Oct 21 '18 at 14:14

0 Answers0