从Android应用程序中消耗一个宁静的API [英] Consuming a restful API from Android app

查看:145
本文介绍了从Android应用程序中消耗一个宁静的API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个使用node.js制作的restful API,并将其部署到Heroku。我想让我的android应用程序向Web API发出请求。我的理解是,我只需要使用任何外部API来发送来自Android应用程序的HTTP请求。
我的假设是否正确?
谢谢

I have created a restful API that I have made using node.js and will deploy to Heroku. I want my android application to make requests to the web API. My understanding is that I will just have to send HTTP requests from the Android app using any external API that does the job. Is my assumption correct? Thank you

推荐答案

是的,您需要进行API调用才能与您宁静的服务器通信。为此,您可以使用以下任何实现。

Yes , you need to do API call to talk to your restful server . For this you can use any below implementation .

发送申请

改造

Retrofit Example

异步客户端示例

这篇关于从Android应用程序中消耗一个宁静的API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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