First Android App – Part 3

1 minute read

I have implemented a core feature of the application where users are able to not only see all 100 questions in sequential order, but they can now show these same questions in a random order.  I also implemented a feature where the user can choose to see only 10 random questions (this is similar to what users will be experiencing in the actual exam where 10 random questions will be given to the user and he/she is expected to answer 6/10 to pass the test).  Below is a screenshot of the work I did for this feature:

Before Random Order

When the user presses either “Random” options item, they get the following:

After Random Selection

Since I am using a custom CursorAdapter to retrieve the data from the database, all I had to do was to create the appropriate methods on my Adapter class to accomplish this. Each of my custom methods returns a Cursor object, and all I had to do was to call the changeCursor(Cursor) method of my custom adapter to update the ListView and show the randomly selected questions!

The next goal for the application is to find the best way to display the answer to the selected question.  This should be fun!

Leave a comment