Real-time communication between app and webpage

梦想与她 提交于 2020-01-06 01:25:15

问题


I'm trying to figure out how to have a real time data displayed on a webpage through the use of an android app.

For example, users are using android app and are scored (answering questions). My webpage will display the scores in order in real-time.

Iv come to the conclusion to use Redis, but what exactly do i need for this to function? Do i need a web socket where my web page will communicate with. This socket could be python where it accesses the database and then responds with the scores in order?

Im struggling to find out how exactly this would work as this is new to me. What exactly should i be looking for (terminology etc)?

Thanks


回答1:


One approach might be:

  1. set up a database on a server on the internet
  2. program your app to save data to that remote database
  3. set up a webservice
  4. program the webservice to read data from the database and serve it as an html page

For extra credit

  1. implement a REST style API which retrieves and serves data from the database
  2. create an ajax webpage which uses the API to fetch and display data (so you don't have to refresh the page constantly)


来源:https://stackoverflow.com/questions/26985577/real-time-communication-between-app-and-webpage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!