0

Basically I'm trying to create an app where it generates random questions and displays them in a dialog box. I've managed to create a dialog box ok but incorporating the sql database full of questions and answers is proving difficult. I've been trying to follow this tutorial and it's the querying and actual gathering of information that I'm stuck on.
http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/

So the overall picture is a randomly generated question from a SQL database to appear in a dialog and once the user has clicked on an option, it displays whether the answer is correct in a Toast widget according to what the answer is, which is also in the SQL database.

Anyone know how I would obtain information from the database/generate a random field from the database?

Any ideas, references to resources, or help will be much appreciated!

Thanks.

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by BlackStar0703
0
  • grab all questions IDs,
  • put IDs in the list
  • generate random from 1 to size of the list
  • get ID from list at position that has value of randomly generated number

You have random question in the simplest way

0

That's the only bit of the task I understand. What I want to find out is how I incorporate the database into Eclipse. Thanks for posting though :)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.