How to reset/renew DHCP in android?

Issue

I want to reset/renew the DHCP in android through code so is there any way/command to achieve the same?

Solution

Try using the WifiManager methods: call disconnect, then reconnect. You’ll need to make sure you have the appropriate permission: I think you’ll need ACCESS_WIFI_STATE and CHANGE_WIFI_STATE at a minimum.

See if that works for you.

Answered By – Femi

Leave a Comment