本文主要是介绍android QtScrcpy 共享屏幕 获取本地Address,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
android QtScrcpy
https://gitee.com/B arryda/QtScrcpy
scrcpy - 手机无线投屏到电脑
https://zhuanlan.zhihu.com/p/80264357?utm_source=wechat_session
public String getLocalIpAddress() {
String ipv4;
List<NetworkInterface> nilist = null;
try {
nilist = Collections.list(NetworkInterface.getNetworkInterfaces());
} catch (SocketException e) {
e.printStackTrace();
}
for (NetworkInterface ni : nilist) {
List<InetAddress> ialist = Collections.list(ni.getInetAddresses());
for (InetAddress address : ialist) {
if (!address.isLoopbackAddress()) {
ipv4 = address.getHostAddress();
return ipv4;
}
}
}
return null;
}
xie博客
这篇关于android QtScrcpy 共享屏幕 获取本地Address的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!