If the game is for Android, you will need to use the database Sqlite and the Sqliteman to manage your database data more easily.
A simple example of how to structure your information would be to create a table with the following fields: _id, question, opcao_a, opcao_b, opcao_c, opcao_d, answer
Remarks:
- As you said the game is similar to the Asked, i assumed that the questions are multiple choice and there are 4 answer options (a,b,c,d) for each question with only one correct answer.
- The field _id is used to make queries and display them using a Cursoradapter, so if you’re not going to use Cursoradapter, you don’t need to use _id.
So a quick step-by-step would be:
- Install Sqlite and Sqliteman
- Create a folder called Assets in "path of your project/app/src/main"
- Open Sqliteman, create a file meubanco.db
Run the following SQL code ( this table is just a suggestion, you can create the schema you think best)
CREATE TABLE perguntas (
_id INTEGER PRIMARY_KEY AUTOINCREMENT,
pergunta TEXT,
opcao_a TEXT,
opcao_b TEXT,
opcao_c TEXT,
opcao_d TEXT,
resposta TEXT
);
- Save the file to the folder Assets
By performing these steps, you will already have the database ready for use in your application. Then came the most boring part: Access of bank information by the application.
Since you said you never messed with databases, I suggest you take a look at the basics of Database and SQL ( especially on the part of keywords)
Now just put your hand in the dough and when you have more specific questions, feel free to ask your questions here :-)
Your doubt is exactly on what part of the implementation?
– Rene Sá
How to insert questions in the database
– Daniel Reis
Thinking quickly, I would create a table for the questions (question column and column with the question), a table for the wrong answers (column with the Question, column with the answer 1, column with the answer 2 and column with the Question) and a table for the right answer (column cadQuestao, column answerCerta and column codResoCerta)
– Rene Sá
That’s what I wanted to know?
– Rene Sá
You need a database editor, don’t you? Which one do you recommend?
– Daniel Reis
The Valentina studio is good?
– Daniel Reis
Sorry, I never used an editor, I use SQL commands myself. If you put the database on a web server, most of them use myPHP admin, you will be able to use it easily.
– Rene Sá
Thanks for the help!
– Daniel Reis
If you are going to keep the data in a local database you will use Sqlite, if you want something remote, search on Webservices.
– JcSaint