简体   繁体   中英

High Score Board for Android

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.

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.

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()).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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