Using apple mdns service in android

1.5k views Asked by At

I downloaded dns_sd jar from here http://www.java2s.com/Code/Jar/d/Downloaddnssdjar.htm and trying to use it in my android project to discover services.

I use the DNSSD.browse(myService, myBrowseListener) to discover services.

The problem is I keep getting

com.apple.dnssd.AppleDNSSDException: DNS-SD Error -65563: SERVICENOTRUNNING

Heard that mdnsd daemon is not always running on android. How do I start it or what is the workaround?

Note: I do not want to use any other library like jmdns, mdnsjava, waiter, etc...

2

There are 2 answers

2
Ian Levesque On

There's actually no need to use Apple's mDNS service because Android Network Service Discovery (available in 4.1) is fully compatible with it. I know you said you do not want to use another library but you must because there is no way to start the Apple mDNS daemon on Android.

0
Andriy Druk On

Workaround for starting mDNSReponder daemon:

context.getSystemService(Context.NSD_SERVICE);

More details here