简体   繁体   中英

Best way to store player data in sports tracking android app?

I am creating a live sports tracker app (using java, android studio and SQLite) that tracks events and scores during a game. A button will be pressed to increment the event/score associated with a particular player and this information will be displayed later using analytics. A player will be able to log in and view their individual stats from a particular game and I am wondering what is the best way to store this data using SQLite? eg. should the database be updated each time an event is recorded or should the stats be passed to the database after the game?

Apologies if this is obvious/confusing, I am a beginner.

I think you need to consider whether SQLite is what you want. With SQLite each device will have it's own database per device.

So if each player has their own device then each will have to input the same data which would probably lead to unintentional inconsistencies. If their is just the one device then fine.

If multiple devices then you probably want to consider the database not being on the device but it existing on a server or in the cloud (Firebase may then be the solution).

From an aspect of not potentially losing/missing data then when an event happens may be the best time. However, conversely what if decisions, such as a score being disallowed after the fact (review of the event).

In short consideration of the actual use should be considered as to when the database is updated.

When it boils down to it database wise, it would probably make little difference if the data were applied when an event happens or after the game. What would probably be more relevant is the convenience of when data is recorded/applied.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM