Search code examples
androidpythonsocketsredisreal-time

Real-time communication between app and webpage


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


Solution

  • 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)