处理命令“arp -a”在Android上? [英] Process command "arp -a" on android?
本文介绍了处理命令“arp -a”在Android上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试在我的Android设备上调用arp -a,但由于它只适用于PC - 我该如何更改?有没有办法访问一个IP地址列表,arp -a给你,但在Android上呢?
I'm trying to call "arp -a" on my android device, but since it only works for pc - how do i change this? Is there a way to access a list of the ip-addresses, that arp -a gives you, but on android instead?
我的代码在android设备上是这样的:
My code is like this on the android device:
try {
Process process = Runtime.getRuntime().exec("arp -a");
process.waitFor();
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
int i = 0;
while (reader.ready()) {
i++;
String ip = reader.readLine();
if (i >= 4) {
ip = ip.substring(2, 15) + "\n";
}
}
} catch (IOException | InterruptedException ioe) {
ioe.printStackTrace();
}
推荐答案
安装busybox和一些终端模拟器,连接到Wi-Fi,你就完成了。
Install busybox and some terminal emulator, connect to Wi-Fi and you are done.
这篇关于处理命令“arp -a”在Android上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文