积分榜 [英] High scores table

查看:161
本文介绍了积分榜的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我期待添加(本地,不在线)高分表到我的Andr​​oid应用程序,我想坐上去解决这个问题的最好办法的一些见解。

I am looking to add a (local, not online) high scores table to my Android app and I wanted to get some insight on the best way to approach the problem.

我有一个用户列表(现在被保存到一个文件,并回读为用户对象的数组),而高分需要引用这个数据来填充表与用户的姓名和照片,等等。

I have a list of users (right now being saved out to a file and read back in as an array of User objects), and the high scores need to reference this data to populate the table with the user's name and photo, etc.

有关的显示,我觉得 TableLayout 很可能是我的最好的选择。我可以列头像,姓名,成绩等。

For the display, I think a TableLayout would probably be my best option. I can make columns for picture, name, score, etc.

有关信息本身,我想也许SQLite表将组织我的数据的最佳方式是什么?如果是的话,那么它可能是值得我的用户数据移动到SQLite表以及这样我就可以确保数据的交叉引用正确的。

For the information itself, I'm thinking maybe a SQLite table would be the best way to organize my data? If so, then it may be worthwhile to move my user data to a SQLite table as well so I can ensure the data is cross-referenced properly.

下面是否有人对此有什么有用的信息或意见?谢谢你。

Does anybody here have any helpful information or opinions on this? Thanks.

更新:我去(使用两个表)SQLite数据库和它的伟大工程!是不是太努力地学习,并得到任何工作。对于布局,它变成了一个与自定义适配器的ListView 是要完成我想要的东西(比TableLayout更灵活的)最好的方法。

UPDATE: I went with the SQLite database (using two tables) and it works great! Wasn't too hard to learn and get working either. For the layout, it turns out a ListView with a custom adapter was the best way to accomplish what I wanted (more flexible than a TableLayout).

推荐答案

我没有做了很多的Andr​​iod,但我相信你是在正确的道路上。使用SQLite的数据,不仅有利于保持你的数据结构和组织它可以让你的数据集成倍增长,你可以使用一个共同的标准方式,从SQL数据库去使用DAO模式的对象。我会建议使用SQLite与MyBatis的。 MyBatis的是对象关系映射工具的Java。它允许你写SQL和取回结果Java对象。 MyBatis的

I haven't done a lot with Andriod but I believe you are on the right path. Using the SQLite for data will not only help keep your data structured and organized it will allow your data set to grow exponentially and you can use a common standard way to go from SQL database to Objects using a DAO pattern. I would recommend using SQLite with MyBatis. MyBatis is an Object Relational Mapping utility for java. It allows you to write sql and get back your results as java object. MyBatis

这篇关于积分榜的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆