Android – assign static IP to Ethernet card from OTG

I want to assign a static IP to the Ethernet card and connect to the Android device through the OTG cable. It should be done programmatically, but I can't find any reference about the Ethernet card in Android

Any ideas?

thank you

@R_ 419_ 1911@:

If it's a rooted device, you can try this

Process process = Runtime.getRuntime().exec(new String[] { "su", "-c", "netcfg eth0 192.168.0.123"});
process.waitFor();

You can also use ifconfig instead of netcfg

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>