3

I want to use the rundhcp() function in NetworkUtils as mentioned in this post.

How do you get the current DNS servers for Android?

I need it to get Dhcp object for mobile connection. But the NetworkUtils class does not seem to be part of the sdk. It is also not referred in the developer documentation.

How do I include and use NetworkUtils class in my app.

Community
  • 1
  • 1
Lakshman Chilukuri
  • 1,067
  • 2
  • 11
  • 20

1 Answers1

0

Maybe this will suffice?

    WifiManager wifiManager = (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE);
    WifiInfo wifiInfo = wifiManager.getConnectionInfo();
    DhcpInfo dhcp = wifiManager.getDhcpInfo();
jayeffkay
  • 1,229
  • 1
  • 16
  • 22