android-ethernet-adapter

com.github.kopihao:android-ethernet-adapter:1.0.1@aar'

License

License

Categories

Categories

Net
GroupId

GroupId

com.github.kopihao
ArtifactId

ArtifactId

android-ethernet-adapter
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

aar
Description

Description

android-ethernet-adapter
com.github.kopihao:android-ethernet-adapter:1.0.1@aar'
Project URL

Project URL

https://github.com/kopihao/android-ethernet-adapter
Source Code Management

Source Code Management

https://github.com/kopihao/android-ethernet-adapter

Download android-ethernet-adapter

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.kopihao/android-ethernet-adapter/ -->
<dependency>
    <groupId>com.github.kopihao</groupId>
    <artifactId>android-ethernet-adapter</artifactId>
    <version>1.0.1</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/com.github.kopihao/android-ethernet-adapter/
implementation 'com.github.kopihao:android-ethernet-adapter:1.0.1'
// https://jarcasting.com/artifacts/com.github.kopihao/android-ethernet-adapter/
implementation ("com.github.kopihao:android-ethernet-adapter:1.0.1")
'com.github.kopihao:android-ethernet-adapter:aar:1.0.1'
<dependency org="com.github.kopihao" name="android-ethernet-adapter" rev="1.0.1">
  <artifact name="android-ethernet-adapter" type="aar" />
</dependency>
@Grapes(
@Grab(group='com.github.kopihao', module='android-ethernet-adapter', version='1.0.1')
)
libraryDependencies += "com.github.kopihao" % "android-ethernet-adapter" % "1.0.1"
[com.github.kopihao/android-ethernet-adapter "1.0.1"]

Dependencies

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

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

Versions

Version
1.0.1