通过USB在Real设备上将localhost API与Android Studio连接时发生超时错误 [英] Timeout Error when connecting localhost api with Android Studio on Real devices through USB

查看:101
本文介绍了通过USB在Real设备上将localhost API与Android Studio连接时发生超时错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Windows 8.1上使用Android Studio版本3.安装了XAMPP以在本地主机上托管php api.我正在尝试从Android Studio访问本地主机api.

I am using Android Studio version 3 on Window 8.1. There is XAMPP installed to host php api on localhost. I am trying to access the localhost api from Android Studio.

在主机名中,我使用了IPv4地址.

In the host name, I used IPv4 Address.

当我使用仿真器从Android版本3访问它时.完全没有问题.我正在使用Volley进行api调用.

When I access it from Android Version 3, using Emulator. There is no problem at all. I am using Volley for api calls.

当我尝试通过USB使用Real设备访问时...总是会出现超时错误.

When I try to access using Real device through USB...I always get timeout error.

我正在使用Real设备,因为我的RAM很低.

I am using Real device because my RAM is very low.

如果您需要更多信息,请告诉我.

Please let me know if you need more info.

更新1

我可以确认Android 2.2.3可以正常工作以通过USB在读取设备上运行apk

I can confirm that Android 2.2.3 is working fine to run the apk on read device through USB

推荐答案

我禁用了防火墙,并且一切正常.

I disabled the Firewall and everything is working perfectly.

这篇关于通过USB在Real设备上将localhost API与Android Studio连接时发生超时错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆