I am able to get the current IP address of my device/machine that I am using - by using this question\'s answer.
I have gone through this question. Java allows to ge
You need to read the routing table - basically the same way as "netstat -r" command does. The netstat implementation is opensource - it's in the package
network_cmds-396.6
at
http://www.opensource.apple.com/release/mac-os-x-1082/
so you can check what it does. The default gateway contains the "G" flag but shouldn't connect the "I" flag (when both wifi and cell are active, wifi is used for internet connection - the cell gateway is not used and is given the "I" flag).
Hope it helps.