Skip to content

Convenient way to access android.net.EthernetManager that is a hidden Native Android API without complex Android SDK setup.

License

Notifications You must be signed in to change notification settings

kopihao/android-ethernet-adapter

Repository files navigation

Android Ethernet Adapter

Logo

What's good?

Convenient way to access android.net.EthernetManager that is a hidden Native Android API without complex Android SDK setup.

Java reflections work behind the scene.

Minimal methods to get things work

  • Provides various EthernetManager.class methods:

    1. boolean isSupported();
    2. boolean isEthEnabled();
    3. void setEthEnabled(boolean enable);
    4. void updateEthDevInfo(boolean dhcp, String ip, String gateway, String subnetmask, String dns);
    5. EthernetConfig getSavedEthConfig();
  • EthernetConfig value:

    1. dev_name
    2. ipaddr
    3. netmask
    4. routeAddr
    5. dns
    6. mode
  • Get new instance simply by:

EthernetAdapter ethernetAdapter = new EthernetAdapter(getApplicationContext()); 

Warning

  • 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

Demostration

Preview

Please checkout source code

Add to your Android project

dependencies {
  implementation 'com.github.kopihao:android-ethernet-adapter:1.0.1'
} 

More Information

For documentation and additional information please visit official website.
For enquiries and solutions please visit stackoverflow.

License

Licensed under the GNU General Public License v3.0 (the "License");
Copyright 2013 Kopihao.MY

About

Convenient way to access android.net.EthernetManager that is a hidden Native Android API without complex Android SDK setup.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages