Jump to content



Photo

android default gateway?


  • Please log in to reply
2 replies to this topic

#1 Original Poster

Original Poster

    C++ n00b

  • Tech Issues Solved: 1
  • 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 Original Poster

Original Poster

    C++ n00b

  • Tech Issues Solved: 1
  • Joined: 15-July 08
  • Location: my room
  • OS: windows 7, backtrack 5, OSx 10.6

Posted 28 March 2013 - 21:21

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

Obi-Wan Kenobi

    "You were the chosen one!"

  • Joined: 11-November 02
  • Location: West-Central Texas

Posted 28 March 2013 - 21:31

O.o