I'm right now implementing the DNS-DS library "mdnsjava" into my Android-project as it's mentioned at several positions, for example here at SO:
Are there any other Java libraries for bonjour/zeroconf apart from JMDNS?.
While implementing, I wonder if this implementation is really using any cache and/or how stable it might perform.
Right now I'm using jmDNS for the last 2 years but this library wasn't able to keep the cache while pausing the discovery (app in background).
Additionally, jmDNS was slow & unstable with discovering the devices.
So, has anyone any experience with mdnsjava?
Meanwhile I can say, that mdnsjava is working very very good and stable in most situations. Much better & faster compared to jMDNS.
Here's some code to restart the full discovery and to start/stop the discovery, maybe it helps someone:
You can start/stop the discovery with the mentioned methods, and reset the whole discovery via
I switched from JmDNS to mdnsjava because JmDNS simply didn't seem to work properly. Sometimes it would not detect anything.
I have very good experience with mdnsjava and have contributed slightly to it, by adding a pom.xml and pointed at a few simple bug-fixes. The only thing about mdnsjava is that it doesn't seem to be able to completely restart itself from scratch for some reason (reset exactly all state of the running program), but as long as it's up it works flawlessly for me. I didn't notice any other problems with my Android background-services using it. I pointed about the reset problem to the author, and he said he had experienced the same issue, and that if he had time, he might look at it some day.