// 子网掩码
private static final String ETHERNET_STATIC_NETMASK = “ethernet_static_netmask”;
// DNS1
private static final String ETHERNET_STATIC_DNS1 = “ethernet_static_dns1”;
// DNS2
private static final String ETHERNET_STATIC_DNS2 = “ethernet_static_dns2”;
EthernetManager
EthernetManager mEthManager = (EthernetManager)getSystemService(Context.ETHERNET_SERVICE);
GET
checkStaticIP = (CheckBox) findViewById(R.id.checkStaticIP);
checkStaticIP.setChecked(Settings.System.getInt(contentResolver,
ETHERNET_USE_STATIC_IP, 0) != 0);
checkStaticIP
.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView,
boolean isChecked) {
android.provider.Settings.System.putInt(
contentResolver, ETHERNET_USE_STATIC_IP,
i