[英]Can't connect to localhost in Android
I have an android project which I made in my desktop .I connect to the internet over wifi .But when I run the same project in laptop I cant connect to internet over my mobile data operator. 我有一个在桌面上制作的android项目。我通过wifi连接到Internet。但是当我在笔记本电脑上运行同一项目时,我无法通过移动数据运营商连接到Internet。 Where's the problem?
哪里出问题了?
I found "No internet connection" as volleyError 我发现“没有互联网连接”为volleyError
The way I do this is by using port forwarding: 我这样做的方法是使用端口转发:
Basically now on 8888 your mobile will the connect to the computers localhost. 现在基本上在8888上,您的手机将连接到计算机localhost。 Note: Make sure that chrome is open on both your laptop and the device.
注意:确保Chrome在笔记本电脑和设备上均打开。 And when you type chrome://inspect you should be able to see the device you have attached.
而且,当您输入chrome:// inspect时,您应该能够看到已连接的设备。
Refer to this for more help: https://developer.chrome.com/devtools/docs/remote-debugging 请参阅此以获得更多帮助: https : //developer.chrome.com/devtools/docs/remote-debugging
Also add <uses-permission android:name="android.permission.INTERNET"/>
to your Androidmanifest.xml 还要将
<uses-permission android:name="android.permission.INTERNET"/>
到您的Androidmanifest.xml中
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.