开发者

How to get and show data on web, after posting data from android app

开发者 https://www.devze.com 2023-03-26 21:43 出处:网络
I am new to android and working on a project that will display data, that android will send on web, I have done posting from android using HTTP Client and HTTP Post, and got the response OK after post

I am new to android and working on a project that will display data, that android will send on web, I have done posting from android using HTTP Client and HTTP Post, and got the response OK after posting. Now, My Que开发者_开发知识库stion is that, how can I get it on web and display that data on web page each time new data is posted.


Did you write a program on the server side that accepts the incoming data from the Android device? That same program needs to store the data somewhere (in a file or database).

That program could simply output an HTML file containing the posted data. The browser could simply load a URL that points to that HTML file to see the data.

Or you could write a second program that resides on the server whose purpose is to read the data from the file/database and present it to the browser as an HTML document. With some client-side JavaScript, the browser could periodically query the server to see if new data has arrived.

The key insight here is web clients (Android devices and web browsers) are independent of each other; neither "knows" of the existence of the other and they can't directly talk to each other. Consequently, you need an intermediate store (files or database) to hold onto the data in order to pass it to the other client.

0

精彩评论

暂无评论...
验证码 换一张
取 消