获取 Android 中连接到互联网的其他应用程序的 IP 地址?

Get the IP Adresses of other apps connected to the internet in Android?

我想获取连接到互联网的不同 android 应用程序的 IP 地址。例如。 Google Play 服务连接到 173.194.39.8。或者 Internet 应用程序已连接到 xxx.xxx.xx.x。 我知道这是可能的。但我不确定如何接收这些 IP 地址。我怎样才能得到它们?我需要根访问权限吗?提前致谢。

为什么不通过命令行 运行 "netstat"?

检查这个问题:java write netstat in cmd

只需 Google 搜索即可在 Java 中找到类似的 "netstat" 实现:

https://github.com/hyperic/sigar/blob/master/bindings/java/src/org/hyperic/sigar/cmd/Netstat.java

https://gitorious.org/networklog/networklog/source/60cb640ac27f8b4fb06f11d9d81c94591a531862:src/com/googlecode/networklog/NetStat.java

此应用程序会显示所有 ip 本地地址 https://play.google.com/store/apps/details?id=com.mobiskills.admin.myapplication