Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JmDNS doesn't work properly on android 4.1

Tags:

android

jmdns

JmDNS

I am implementing JmDNS as follows here. When running the code on my android 2.3.5 htc Evo I am able to discover my linux computer. However, when i run the same code on my samsung galaxy s3 (4.1.0) nothing shows up. What is strange is that it was working on my 4.1 a week ago and now it isn't. I have tried someone else's solution here but no luck. If any one has experienced this and could shed some light on why gingerbread is working with jmdns but not jellybean.

Clarification:

My android 4.1 device will not resolve any services except for those that are created from the device. My 2.3 device will resolve services except those created from the 4.1 device. could it be ip6 to ip4?

like image 694
skukx Avatar asked Dec 12 '22 20:12

skukx


1 Answers

Solved:

I partially followed the advice here but instead of create(String hostName) I did create(InetAddress addr).

String ip = Formatter.formatIpAddress(wifiManager.getConnectionInfo().getIpAddress());
_bindingAddress = InetAddress.getByName(ip);
_jmdns.create(_bindingAddress);
like image 145
skukx Avatar answered Dec 27 '22 07:12

skukx