Hello,Dean,
I checked API in networkutils:
private native static boolean configureNative(
String interfaceName, int ipAddress, int netmask, int gateway, int dns1, int dns2);
I think if you load it in your setting program, static ip should be configured. I got a section of code from internet, but i didn't test, you can test it if it is OK:
ConnectivityManager mService = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
EthernetManager mEthManager = (EthernetManager) getSystemService(Context.ETHERNET_SERVICE);
if(mEthManager.getState() == EthernetManager.ETHERNET_STATE_ENABLED) {
EthernetDevInfo mInterfaceInfo = mEthManager.getSavedConfig();
String mIp;
String mMask;
String mGw;
String mDns;
mIp = "192.168.0.118";
mMask = "255.255.255.0";
mGw = "192.168.0.1";
mDns = "192.168.0.1";
mInterfaceInfo.setConnectMode(EthernetDevInfo.ETHERNET_CONN_MODE_MANUAL);
mInterfaceInfo.setIpAddress(mIp);
mInterfaceInfo.setNetMask(mMask);
mInterfaceInfo.setDnsAddr(mDns);
mInterfaceInfo.setGateWay(mGw);
try{
mEthManager.updateDevInfo(mInterfaceInfo);
Thread.sleep(500);
}catch(Exception e){
e.printStackTrace();
}
} else {
Toast.makeText(this, "Ethernet state disabled!", 5000).show();
}
Regards,
Weidong