简体   繁体   English

在运动跟踪 android 应用程序中存储球员数据的最佳方式?

[英]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.我正在创建一个实时体育跟踪器应用程序(使用 java、android 工作室和 SQLite),用于跟踪比赛期间的事件和得分。 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?玩家将能够登录并查看特定游戏的个人统计数据,我想知道使用 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.我认为您需要考虑 SQLite 是否是您想要的。 With SQLite each device will have it's own database per device.使用 SQLite,每台设备都将拥有自己的数据库。

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).如果有多个设备,那么您可能要考虑数据库不在设备上,但它存在于服务器或云中(Firebase 可能是解决方案)。

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.可能更相关的是记录/应用数据时的便利性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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