Android应用程序与Web服务器的通信? [英] Android app communication with web server?

查看:118
本文介绍了Android应用程序与Web服务器的通信?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我来自基于Java的Web应用程序背景,其中客户端是瘦客户端,即浏览器和所有UI页面(HTML,CSS,JS)以及 数据来自服务器.但是随着最近对基于Android的移动应用程序的网上阅读以及基于堆栈溢出的Q/A的理解,有了这种理解

I am coming from java based web application background where client is thin client i.e. browser and all UI pages(HTML,CSS,JS) along with data comes from server. But with recent read on net about android based mobile apps and based on Q/A on stack overflow came with this understanding

具有后端(从服务器获取数据)的Android应用程序就像两个在http上相互通信的应用程序一样.当我说两个应用程式时,这些 一个是在移动设备上的,它是java(android)应用程序,第二个是在服务器上,该服务器通常通过可以使用任何语言的网络服务公开 像java/dot net.是对的吗?

Android app with backend(where data is fetched from server) is like two application communicating with each other on http. When I say two app , these are one on mobile which is java(android) application and second is on server which is generally exposed through web services which can be in any language like java/dot net. Is it correct ?

如果是的话,将其与基于Java服务器的Web应用程序进行比较时,我会怀疑这是关于UI页面的位置.在网络应用程序中, UI视图以HTML形式从服务器返回.但是我很困惑UI页面驻留在android应用程序中的位置.通常在客户端(所有ui页面) 与app下载.对于不同的事件,应用程序从客户端本身提供UI,但数据来自服务器)还是它们由服务器提供? 如果从服务器将它们再次用作HTML,或者还有其他更好的android格式的格式?

If yes I have one doubt when comparing it with java server based web app This is in regard of where UI pages . In web application, UI views are returned from server in the forms of HTML. But I am confused where UI pages resides in android app. Is it generally on client side(all ui pages are downloaded with app . With different events app serves the UI from client side itself but data comes from server) or they are served from server ? If from server are they served again as HTML or there is some other format that android better gels with ?

可能是android应用,一般不应期望服务器上有任何UI页面,这意味着下载的应用应具有所有UI页面.

May be android app generally should not expect any UI pages from server which means downloaded app should have all UI pages with it.

推荐答案

我认为UI仍在客户端上,而用于填充UI的内容则来自服务器.此内容以HTTP(s)协议传输,因此按照您所说的HTML格式传输.但是我猜可以使用其他协议从服务器获取响应.

I think the UI is still on the client while the content for filling of the UI is from the server. This content is transported in HTTP(s) protocol, therefore in HTML format as you said. But one can use other protocols to get the response from the server I guess.

这篇关于Android应用程序与Web服务器的通信?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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