I want to use Android Network Service Discovery (NSD) function to discover some local network services advertised on local domain. I read the official documentation on Android website about Android NSD. I can find the network services advertised on .local domain without problem. But I have some other network services that are advertised not directly on .local domain, but on a domain like mydevice.mycompany.local
. In the Android NSD API example, there is a function to discover the service with given service type ("_http._tcp."), protocol, and listener:
discoverServices("_http._tcp.", NsdManager.PROTOCOL_DNS_SD, mDiscoveryListener);
This by default only discovers the network service on .local
domain, not on the other local domain like my case mydevice.mycompany.local
. However, I installed a Bonjour app on Android and it can find the other domain services. So I think there is a way to get those network services by code.
I browsed through Android NSD API and didn't find an option to let me specify the domain name from which I want to discover services. So how can I use Android NSD code to discover the local network services on a domain like that?