Java – High score table

High score table… here is a solution to the problem.

High score table

I want to

add a (local, not online) high score table to my Android app, and I want to dive into the best way to solve the problem.

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

For display, I think TableLayout is probably my best bet. I can create columns for pictures, names, scores, etc.

For the information itself, I thought maybe SQLite tables are the best way to organize your data? If so, it might be worthwhile to move my user data to SQLite tables as well, so I can make sure the data is cross-referenced correctly.

Does anyone here have any useful information or comments on this? Thank you.

Update: I used a SQLite database (using two tables) and it worked great! It is also not too difficult to study and work. For layouts, the result is ListView using a custom adapter is the best way to achieve the effect I want (than TableLayout is more flexible).

Solution

I

don’t know much about Andreod, but I believe you’re on the right path. Using SQLite for data not only helps keep data structured and organized, but also allows datasets to grow exponentially, and you can use a common standard approach from SQL databases to objects that use DAO schemas. I recommend using SQLite with MyBatis. MyBatis is Java’s object-relational mapping utility. It allows you to write SQL and return the result as a Java object. MyBatis

Related Problems and Solutions