I am creating a mobile app that displays a score of an ongoing soccer game (amateur game, not professional). So, what I am basically doing is, I am creating a data of a soccer game in the Firebase real-time DB which might contain information like:
Team A: String
Team B: String
Score A: int
Score B: int
isLive: true/false
id: int
currentTime: ???
So, when I press the Score Update
in my app, it will update the score, and will apply this change to a ListView in my app.
Everything seems clear up to this point, but I am having a trouble of displaying the current game time.
I wanted to work something like:
This is from the web app (http://livescore.com) that I was motivated by. When a game begins, the game time is displayed from 1min to 90min as shown in the image and turns in to FT
when it is over.
My question is,
is it possible to make like an automatically incrementing timer in Firebase database, or is it possible to make it work like it is incrementing 1 to its value every 1 minute up to a certain point?
Any kind of advice would be appreciated.