• 0

android default gateway?


Question

I need help with finding a snippet of code which would allow me to find the default gateway of the wifi connection :/ in a useable IPV4 address on an android device??

this is what i have so far...


networkd = (WifiManager) getSystemService(Context.WIFI_SERVICE);
details = networkd.getDhcpInfo();
gateway = "Default Gateway: "+String.valueOf(details.gateway);
[/CODE]

this just returns an string of numbers which is not a usable IPV4

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

I need help with finding a snippet of code which would allow me to find the default gateway of the wifi connection :/ in a useable IPV4 address on an android device??

this is what i have so far...


networkd = (WifiManager) getSystemService(Context.WIFI_SERVICE);
details = networkd.getDhcpInfo();
gateway = "Default Gateway: "+String.valueOf(details.gateway);
[/CODE]

this just returns an string of numbers which is not a usable IPV4

just so everyones knows I found a solution :)

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.