I\'m trying to run an application using Android Native Service Discovery but sometimes when I run the application, it doesn\'t discover all services from my network. I\'m runnin
I tend to think the whole NSD implementation in Android must be a bit flaky. I also have a simple Activity just to demonstrate the lifecycle (no Sockets are opened), and sometimes it works, and sometimes it does not work. I simply don't get it. Here is the Activity if anybody has some insight:
https://github.com/mholzel/Dump/blob/master/NetworkServiceDiscoveryViaWifi.java
On the other hand, Wifi Direct based NSD seems to be very reliable for me:
https://github.com/mholzel/Dump/blob/master/NetworkServiceDiscoveryViaWifiDirect.java
Note that neither of these Activities have any resources, so just add the Activities to your Manifest with the proper permissions.