Android无法访问本地服务器(localhost)的解决方案
来源:互联网 发布:mysql数据库实训 编辑:程序博客网 时间:2024/06/14 08:33
最近在Android开发中,发现无法访问localhost(127.0.0.1)。
Google之,得解:
Issue 133: localhost/127.0.0.1 not supported
原因分析:
Android模拟器把它自己作为了localhost!
换言之:使用localhost(127.0.0.1)访问的都是模拟器自己而非本地!
解决方案:
使用Android为本地机器定义的别名(alias):10.0.2.2 来替代localhost(127.0.0.1)即可。
Google之,得解:
Issue 133: localhost/127.0.0.1 not supported
原因分析:
Android模拟器把它自己作为了localhost!
换言之:使用localhost(127.0.0.1)访问的都是模拟器自己而非本地!
解决方案:
使用Android为本地机器定义的别名(alias):10.0.2.2 来替代localhost(127.0.0.1)即可。
- Android无法访问本地服务器(localhost)的解决方案
- Android无法访问本地服务器(localhost)的解决方案
- Android无法访问本地服务器(localhost)的解决方案
- 十七、Android无法访问本地服务器(localhost)的解决方案
- Android无法访问本地服务器(localhost)的解决方案
- Android无法访问本地服务器(localhost)的解决方案
- Android无法访问本地服务器(localhost)的解决方案
- Android无法访问本地服务器(localhost/127.0.0.1)的解决方案
- 十七、Android无法访问本地服务器(localhost)的解决方案
- Android无法访问本地服务器(localhost)的解决方案
- Android无法访问本地服务器(localhost)的解决方案
- Android无法访问本地服务器(localhost)的解决方案
- 十七、Android无法访问本地服务器(localhost)的解决方案
- Android访问本地服务器(localhost)的解决方案
- Android真机调试访问本地服务器(localhost)的解决方案
- 真机与Genymotion模拟器调试Android应用不能访问本地服务器(localhost)的解决方案
- Android真机 usb调试 访问本地服务器(localhost)的解决方案
- 安装IIS后无法访问本地服务器的解决方案
- webview中拦截超链接
- c++程序员 常用工具集
- Flex在匿名方法移除自身的侦听方法
- 晶圆厂:政府无力承受之轻
- Ubuntu 和Fedora 以roo用户自动登陆
- Android无法访问本地服务器(localhost)的解决方案
- android manifest.xml中元素含义
- 让hr显示无边框有颜色某高度IE,firefox
- flash 与随机性:随机抽取(3)
- sql Text
- 《Pragmatic Programmer》读后感(二):从重复到重用,路在何方?
- android应用开机自动运行程序
- OASIS announced Content Management Interoperability Services (CMIS) Version 1.0
- 触发器的命名方法