Have you suc开发者_开发技巧ceeded in service discovery using jmdns in Android? I'm facing same problem not able to discover services using jmdns in Android.
From my code using jmdns I am trying to discover services of type:
jmdns.addServiceListener("_afpovertcp._tcp.", listener);
ServiceInfo[] infos = jmdns.list("_afpovertcp._tcp.");
I have installed _afpovertcp._tcp service type (Avahi package) on my Linux Ubuntu PC. My Android phone with my code and linux machine both are configured to WI-FI. Still not able to discover my Linux PC.
Yes make sure you are using the latest jMDNS from Sourceforge in their SVN repo and you can see our example in Android here from our open source app.
http://code.google.com/p/tunesremote-plus/source/browse/trunk/src/org/tunesremote/LibraryActivity.java
Add the internet permission to your manifest.xml
<uses-permission android:name="android.permission.INTERNET" />
In addition you have to implement the listener. Can you show us your implementation? It has to look like here: Samples with JmDNS
精彩评论