如何从Android应用程序调用web apis? [英] How to call web apis from android app ?

查看:78
本文介绍了如何从Android应用程序调用web apis?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



i我将从Android调用web api工作当我使用android studio的模拟器但是当我使用我的手机作为emulaotr时不起作用





我的尝试:



i am打算从android调用web api当我使用android studio的模拟器时工作但是当我使用我的手机作为emulaotr


i am going to call web api from android it work when i use emulator of android studio but does not work when i use my mobile as an emulaotr


What I have tried:

i am going to call web api from android it work when i use emulator of android studio but does not work when i use my mobile as an emulaotr

推荐答案

检查出来时< a href =http://hintdesk.com/how-to-call-asp-net-web-api-service-from-android/>如何从Android调用ASP.Net Web API服务? [ ^ ]


一个猜测是您的API在只能在计算机内访问的本地服务器上运行。所以当你从你的设备访问它时,你不能使用它



尝试访问任何外部API,你可以创建一个示例API,获得服务器托管从任何免费提供商在真实设备上测试。由于它适用于模拟器,我认为它没问题。
One guess is that your API is running on a local server that is only accessible within the machine. So when you access it from your devices, that are outside, you cannot consume it

Try accessing any external API, you may create a sample API, get a server hosting from any free provider to test that on a real device. Since it works on emulator, I will assume it is fine.


这篇关于如何从Android应用程序调用web apis?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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