Since jmDNS does not support the service browse by subtypes, I went with cross compiling the bonjour for android, and I followed the below steps.
But when I call the DNSServiceBrowse the error response I am getting is DNS service call failed -65563
, "Background daemon is not running".
Generally while running on the linux we start mdns daemon.
How do I fix this problem? Any suggestions?
But when I call the DNSServiceBrowse the error response I am getting is DNS service call failed -65563, "Background daemon is not running".
You can't run daemons within Android. See: Android daemon process
In order to use the mdnsresponder in an embedded implementation, you must communicate with the mDNSCore directly. See the "How it Works" section of this ReadMe at [1].
How do I fix this problem?
Check out the "Note" section in mDNSEmbedded.h at [2] Basically rather than communicating through the daemon, you need to use the dnssd_clientshim.c at [3]. This allows you to "still use the preferred dns_sd.h APIs by linking in "dnssd_clientshim.c", which implements the standard "dns_sd.h" API calls, allocates any required storage using malloc(), and then calls through to the low-level malloc-free mDNSCore routines"
Note: It appears that the dnssd_clientshim.c has some spelling errors and missing reference that will prevent compiling so you need to perform a patch when building (see [4] & [5]). It also appears you still need to include dnssd_clientlib.c when compiling or you'll get build errors with TXTRecord function references.