This tutorial demonstrates how you can use SQLite in your Android application to build a list of high scores.
Why Use SQLite in your Android App?
SQLite can be a powerful tool that makes it easy to store, access, and manipulate data.
Say that you have designed a game for Android, and you would like to keep track of the user's high scores for the game. You could store the high scores in an SQLite database, and retrieve the scores sorted from highest to lowest to display to the user.
I should also note that some basic understanding of SQL would be helpful when reading this tutorial.
Building a Simple App
We are going to build a simple app that will allow us to test using SQLite to store and retrieve our list of high scores. Our app must allow us to easily add new scores and easily retrieve the list of high scores.
The Layout
Our app will include an text input and a corresponding button to add a new high score, and a webview to display the highscores. The webview will refresh whenever a new highscore has been added.
 |
| Screenshot of the layout |
The first text input will contain the name of the player for the high score. The second text input will contain the score.