-1

I have a game where, at the end, if the player's score is higher than any of the saved highscores, they are asked to type in their name in order to save their score. I also have an Activity where the five highscores are displayed, next to the name provided for each one of them.

I don't know how to go about saving the highscores with the name the player provides. I've thought about an Arraylist containing instances of a Highscore class, which store a name and a score, but it seems like overkill.

How should I accomplish this?

Ale-Jandra
  • 83
  • 5
  • Are you trying to save these high scores to the device, or in a database elsewhere? – cjnash Sep 12 '17 at 19:54
  • I'm trying to save them to the device, they only contain this device's scores, so there's no connection to an external server. – Ale-Jandra Sep 12 '17 at 19:55

1 Answers1

-1

Make use of this library to store data using shared preferences https://github.com/Pixplicity/EasyPrefs

Pritesh Patel
  • 678
  • 17
  • 35