开发者

Programmatically find the IP address of the desktop over USB tethering

Is there a way to find the IP address of the desktop machin开发者_JAVA百科e connected the android phone after USB tethering is turned on?

Does android assign a fixed IP address to the desktop? Or does it assign a dynamic address (dhcp)? Is there a PPP connection created between the phone and machine?


With USB tethering it seems that all android devices use the same static addresses, the android device using tcpdump is 192.168.42.129

The attached device will get a DHCP provided address in the same address range.

I listen to a port on my android app and have a udev rule to push the dhclient address back to that port on my app.


AFAIK, in usb tethering mode the phone is acting as the computer's modem, so the PC's IP would be the phone's IP.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜