JmDNS不能正常在Android 4.1工作 [英] JmDNS doesn't work properly on android 4.1

查看:171
本文介绍了JmDNS不能正常在Android 4.1工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

JmDNS

我在执行JmDNS如下这里。当运行我的Andr​​oid 2.3.5 HTC EVO的code,我能发现我的Linux计算机。然而,当我在我的三星Galaxy S3运行相同的code(4.1.0)没有显示。奇怪的是,它正在对我的4.1一个星期前,现在还不是。我已经试过别人的解决方案这里,但没有运气。如果任何一个经历了这一点,并能解释为什么姜饼一些光正与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.

澄清:

我的Andr​​oid 4.1设备将不会除了那些从设备创建解决任何服务。我的2.3的设备才能解决,除了那些从4.1设备创建服务。难道是IP6为IP4?

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?

推荐答案

解决:

我部分地跟着咨询这里而是对创建(字符串主机名)我没有创建(InetAddress类地址)。

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);

这篇关于JmDNS不能正常在Android 4.1工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆