本文介绍了有没有一种方法,使Android设备答案ICMP ping消息给广播地址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想以编程方式让我的设备应答广播坪(即执行ping 192.178.1.255),同时连接到WiFi网络。
有没有办法,我可以做到这一点?也许一个侦听器将平背或标志的地方设置?
感谢。
解决方案
In short: Yes. But it will take some good effort to integrate the necessary components.
The key problem is that you need to listen for ICMP network packets. Such functionality is not accessible from Java and would require either JNI code or an external program. (To my knowledge, it also requires a rooted device.)
You will need a library or program that can process network traffic, such as Jpcap (which would require some modification to work on Android). You could also install and run an instance of tcpdump
in the background and parse its output.
这篇关于有没有一种方法,使Android设备答案ICMP ping消息给广播地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!