I would like to create a simple Math game application in android phone but I don't know what kind of data storage which I should use to keep the sets of numeric for the questions. At this time, I am hesitating with the SQLite and text file. Please suggest me. And If you have any tutorial or example, please give me them.

Appreciate your help.

  • \$\begingroup\$ Your question is hard to understand, and if I am understanding you correctly, you want to know how you should store data for the game to read? The answer to that is however you want to that makes it easy to use. \$\endgroup\$
    – Tetrad
    Feb 23, 2012 at 16:45
  • 2
    \$\begingroup\$ What kind of questions will you be asking and how will you be receiving answers? Can you provide a few samples? \$\endgroup\$ Feb 23, 2012 at 17:35

2 Answers 2


You have lots of choices with android. As the Luis has sated, SQLite or text files (XML, JSON). But you could also store the data in a key-value list, such as a dictionary list or storage list.

Depending on how complex the data is, and what works easiest for yourself will determine what is the best option


What kind of questions are you going to be asking in this application?

something like?:

1 + 1 = ?
6 / 2 = ?

any type of storage is possible, you can use a comma delimited file such that every line would have the question and the answer like so:

"1 + 1","2"
"6 / 2","3"

If you are going to use SQL then you can make a table with the Questions & Answers. You would have two columns "Question" & "Answer" same thing as above.

  • 1
    \$\begingroup\$ Building on this answer, SQLite or text files are I believe a pretty standard way to store local content. Text files might be simpler, but if you store a number of math problems in the same file, you will need to come up with design for storing them, such as one per line. My advice would be to spend some time to learn how to use them and they can solve your problem. The Android developer page on data storage is at developer.android.com/guide/topics/data/data-storage.html if that is useful. \$\endgroup\$
    – Tim Holt
    Feb 23, 2012 at 17:23
  • 4
    \$\begingroup\$ Heck, if your questions are as simple as 1 + 1 = ?, why not just select two operands, an operator, and calculate an answer on the fly and completely forego the need for storing questions? (Unless you're tracking performance or something as well, of course.) \$\endgroup\$ Feb 23, 2012 at 17:34
  • 1
    \$\begingroup\$ What a waste! @chaosTechnician is right. Smartphones' CPU can generate this kind of question easily. \$\endgroup\$ Feb 23, 2012 at 20:52
  • 1
    \$\begingroup\$ The OP didn't state what kind of questions the application would be asking. These are just examples. Having static questions that are more complicated like "5 + 5 / 2 * 3 - 2 + 8" is much easier than generating the expression and parsing it to find the answer. The OP didn't even state if the questions would be word problems or pure math expressions. Overall the OP is hard to understand. \$\endgroup\$ Feb 23, 2012 at 21:03
  • 1
    \$\begingroup\$ @user13781, The comment you're referring to was a comment on the answer that Luis Estrada gave about how, if the questions were that simple, there's no need to store anything. Take it personally if you want to but do notice my comment on your original question was asking you (politely) for more clarification. :roll: \$\endgroup\$ Feb 24, 2012 at 18:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .