user1135750
user1135750

Reputation:

Data storage for Android app

I need to write an application with a lot of questions with 4 variant aanswer for each (tests, in short). Where to store the actual answers and the questions? Create a file, or use SQLlite, or Strinq.xml (although it seems this is the most desirable not).

If I use SQLlite, then for example, if somebody download app, all of my questions and answers should already be there.

Upvotes: 1

Views: 442

Answers (4)

Konstantin Pribluda
Konstantin Pribluda

Reputation: 12367

SQLiteis one option, but depending on amount of data you have to store, private JSON file may be better one - there are data binding frameworks which will convert it into objects without additional code

Upvotes: 2

Rajdeep Dua
Rajdeep Dua

Reputation: 11230

I would suggest using SQLite. It will be easier from upgrade perspective and server sync

Upvotes: 1

Lucifer
Lucifer

Reputation: 29672

You need to design your database which can store such information like below,

Table Name : Questions

field Name : qId ( Primary Key ) question Text(100) answer1 Text (100) answer2 Text (100) answer3 Text (100) answer4 Text (100) correctAnswer Number(1)

however detail designing can add more fields in it.

Upvotes: 1

zaf
zaf

Reputation: 23264

Use SQLlite.

Very easy to setup and you'll have all the power of a database in your app.

Upvotes: 2

Related Questions