从USB访问PC的本地主机连接的Andr​​oid移动设备

从USB访问PC的本地主机连接的Andr​​oid移动设备

问题描述:

我通过USB连接到我的电脑的Andr​​oid设备(三星Galaxy Tab)。

I have an android device (Samsung galaxy tab) connected to my PC via USB .

我要使用Web服务和运行网页位于我的电脑我的本地服务器的XAMPP在我的Andr​​oid设备上。

I want to use WebServices and run a web page which is located on my local xampp server of my PC on my android device .

我能做到,如果我有两个,我的电脑和Android设备,连接到同一个无线网络上。

I can achieve it if I have both , my PC and android device , connected on the same wireless network .

不过是它可以访问本地主机页面无任何无线连接,仅使用USB连接。

However is it possible to access the localhost page without any wireless connection , using only USB connection .

(PS:当我在模拟器上运行应用程序和使用ip 10.0.2.2访问本地主机在我的电脑上同样的情形适用)

(PS : This same scenario works when I run the app on an emulator and use the ip 10.0.2.2 to access the localhost on my PC)

看看在这个的教程来自谷歌。

Take a look on this tutorial from Google.