问题
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 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 ?
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 ?
May be android app generally should not expect any UI pages from server which means downloaded app should have all UI pages with it.
回答1:
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.
来源:https://stackoverflow.com/questions/39191037/android-app-communication-with-web-server