How to configure IP address of non-WiFi Android device programmatically? Android 5.x

I went over all of this and did not use my own solutions.

Basically, I am connecting to another device via an Ethernet cable (this is kind of a hack, don't worry, I know!). This unit cannot use Wi-Fi, Bluetooth, etc. It MUST be over ethernet.

I can communicate with this device over this ethernet, but this requires changing the IP address.

However, I can only find wifi solutions not working. I am hoping for a solution that is more suitable for configuring the IP address for use on this network.

Does anyone have a suggestion?

NOTE. It is looking for a solution to this programmatically / through code.

EDIT: For clarification, this is an attempt with WiFi . No WiFi Manager as WiFi is disabled for this Android device (as needed). Reflection, of course, is fragile, but it seems inevitable.

I started trying something to use the ConnectivityManager and NetworkInterface, but I can't figure out how to get to the "IP rung setting". This is mainly due to the fact that you cannot find anything that will allow you to set the IP address outside the WifiConfiguration (which, as I mentioned, cannot be used here).

+3
android networking ip-address


source to share


No one has answered this question yet

See similar questions:

five
How to set up static IP, netmask, gateway, DNS programmatically on Android 5.x (Lollipop) for Wi-Fi connection

or similar:

3295
Why is the Android emulator so slow? How can we speed up the development of an Android emulator?
2609
Is there a unique identifier for an Android device?
2510
How to persist android activity state by persisting instance state?
1085
How to get client IP address in PHP
843
How can I connect to Android with ADB over TCP?
687
Android error: Failed to install * .apk on device *: timeout
617
How to check Internet access on Android? InetAddress never runs out
561
Set width and height of ImageView programmatically?
560
How do I get the client's IP address using JavaScript?
347
How do I get the IP address of a device from the code?



All Articles
Loading...
X
Show
Funny
Dev
Pics