Real-time communication between app and webpage

2019-08-14 06:54发布

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条回答
手持菜刀,她持情操
2楼-- · 2019-08-14 07:35

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)
查看更多
登录 后发表回答