Convenient way to access android.net.EthernetManager that is a hidden Native Android API without complex Android SDK setup.
-
Provides various EthernetManager.class methods:
- boolean isSupported();
- boolean isEthEnabled();
- void setEthEnabled(boolean enable);
- void updateEthDevInfo(boolean dhcp, String ip, String gateway, String subnetmask, String dns);
- EthernetConfig getSavedEthConfig();
-
EthernetConfig value:
dev_name
ipaddr
netmask
routeAddr
dns
mode
-
Get new instance simply by:
EthernetAdapter ethernetAdapter = new EthernetAdapter(getApplicationContext());
- Android Ethernet only works with signed application with the system signature
- Requires declaration of android:sharedUserId="android.uid.system in AndroidManifest.xml
- Requires signingConfig in build.gradle of application
Please checkout source code
dependencies {
implementation 'com.github.kopihao:android-ethernet-adapter:1.0.1'
}
For documentation and additional information please visit official website.
For enquiries and solutions please visit stackoverflow.
Licensed under the GNU General Public License v3.0 (the "License");
Copyright 2013 Kopihao.MY