This article is intended for Game Developers who want to create a very basic functionality that exist in every type of game "High Score". The code given in this article is about storing the player name and its corresponding score in database object RecordStore.After that there is a very great thing is to display the already stored scores and then sort it out.
Really good coding practice have been followed by writer of this article. Article can become the starting point of every game developers.This Example is tested thoroughly.So any one can try it in their games without any risk of errors.
--Kalki 06:33, 20 September 2009 (UTC)
This article shows how to implement a high score database in Java ME. Such functionality is often built into games to keep track of the highest scores achieved so far. The code example shows how to achieve this using the Record Management System (RMS). The article shows how to add a new score to the database and also how to retrieve the highest scores. If scores are to be sorted (as is usually the case – highest scores are normally sorted in descending order), the article provides an example of the implementation of the RecordComparator interface. An implementation of this interface is passed as a parameter to the enumerateRecords method of the RecordStore class, which ensures that the returned RecordEnumeration is sorted using the provided comparator.
For devices which support JSR-75 (the FileConnection API), this functionality could also be implemented using File I/O. In the case of high-scores stored in a file, however, some sort of basic encryption should probably be maintained to prevent users cheating by directly editing the high-scores file.
--Larry101 13:09, 21 September 2009 (UTC)