Welcome Guest! To access all forums & features, please register an account or sign-in. → Why register?



android default gateway?


2 replies to this topic - - - - -

#1 SPEhosting

    C++ n00b

  • 2,434 posts
  • Joined: 15-July 08
  • Location: my room
  • OS: windows 7, backtrack 5, OSx 10.6

Posted 17 March 2013 - 18:07

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

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


#2 OP SPEhosting

    C++ n00b

  • 2,434 posts
  • Joined: 15-July 08
  • Location: my room
  • OS: windows 7, backtrack 5, OSx 10.6

Posted 28 March 2013 - 21:21

View PostSPEhosting, on 17 March 2013 - 18:07, said:

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

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

just so everyones knows I found a solution :)

#3 Obi-Wan Kenobi

    Neowinian Senior

  • 2,149 posts
  • Joined: 11-November 02
  • Location: West-Central Texas

Posted 28 March 2013 - 21:31

O.o