Reputation: 137
I am trying to implement a high score system inside of my game, I don't know any sql, so I can't write it that way. So I was wandering what would be the best and simplest way to use a tab layout to display a global high score on one and local high score on the other. The scores would be taken from the game activity which uses a surfaceview and be displayed on the high score screen activity. If I need sql to make a global high score I will not use it, if I can at least do the local high score that would be fine.
Upvotes: 0
Views: 1546
Reputation: 396
Check out Swarm's Leaderboard system, which provides pretty much exactly what you're looking for, with almost no effort (pseudocode: .submitScore(1000) and .showScores()).
Upvotes: 0
Reputation: 234795
Besides SQLite, Android offers several other persistent data methods: shared preferences, internal storage, external (sdcard) storage, and network connections to a server. (See here for details.) For device-local data, it sounds like shared preferences would be pretty easy. If you want global high scores to include data from other devices, you'll probably have to set up a central server somewhere to keep the data.
Upvotes: 1