Sign in to follow this  

android default gateway?

Recommended Posts

Original Poster    324

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

Share this post


Link to post
Share on other sites
Original Poster    324

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 :)

Share this post


Link to post
Share on other sites
Obi-Wan Kenobi    1,083

O.o

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.