Whenyou connect your android device to a WiFi network, it is assigned an IP address. This IP address is visible under the "Settings > About Phone > Status > IP Address" . Now, in your case, the server app runs on one tablet, and client on the other. We need the IP address of the Server only, which you can find out using this method. Enter ChangeWiFi's configuration on Android 5 (L) programmatically 9 How to configure a static IP address, netmask, gateway, DNS programmatically on Android 5.x (Lollipop) for Wi-Fi connection Howto set an ip for my domain programmatically in my APP? set an ip for my domain if the DNS Lookup failed. update the ip for my domain when DNS Loopup succeed, and save this IP for later use. The server side use domain name for virtual hosts map, so I can't use IP directly. edit /etc/hosts works, but I need change it programmaticallychange Mac address-Android. Ask Question Asked 8 years, 6 months ago. Modified 3 years, 4 months ago. Viewed 3k times adb shell su ip link show wlan0 ifconfig wlan0 down; ifconfig wlan0 hw ether :18:19 ifconfig wlan0 up; check this post https: Therere some problems with the code worked on android 4.0.2..4.4.4, but doesn't really work on Android 5 and I don't know why. Basically, the code below allows to set new WiFi's IP assignment type: Learnhow to create a local-only Wi-Fi hotspot on your Android device, which allows you to share your device's internet connection with other devices without using a cellular network. This feature can be useful for testing or debugging apps that require network connectivity. Find out how to use the WifiManager API to configure and start a Alsothe ip address changes. So if you are able to get the Wifi config before enabling the hotspot, first of all you can use intf.getName() to get a reference to it. Second, the ip changed, so if you know which interface the wifi is in CONNECTED mode, you can use that info to identify it later on after enabling the hotspot. 1Answer. Sorted by: 0. you need to use static IP. Check these threads: How to configue a static IP address, netmask, gateway programmatically on Android 3.x or Vay Tiền Nhanh Chỉ Cần Cmnd Asideway.

android change ip address programmatically