I am using ksoap2-android and i need to get the IP address using java so that I don't have to type it manually everytime.
What i mean by IP address is , for example if I do ipconfig using the command shell:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : f0::ed2:e3bf:8206:44%13
IPv4 Address. . . . . . . . . . . : 192.168.1.107 <--THIS ONE
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1
The thing is am developing an android app, and the emulator has a different type of IP's than the machine's .
I need to get the machine's IP , how is this to be done?
thanks a lot
See Also
getHostAddress()
To get the Ipaddress of your android device you use this code.
Try this link
http://www.droidnova.com/get-the-ip-address-of-your-device,304.html
also you can try this command adb shell netcfg