Question about screens of a quiz (quiz)

0

I'm making an APP like this from the image below. My question is how to do it, for example as we can see, you have 35 questions and the first one is answered, in which case you have 35 Activity ?

What would be the best approach in this case?

In my APP, you will have an option to register the questions, so I do not know the exact number of questions that the questionnaire will have ...

Thank you!

    
asked by anonymous 30.12.2014 / 13:43

1 answer

5

Your question can be answered with a simple context analysis:

It makes sense for you to change the user context (change Activity ) just to change the question? If you think it makes sense, then the answer is yes, you will need to create a Activity for each question.

But, in my opinion, it does not make sense to just change the user context for this. You can either use Fragments , or update the same Activity , by making an animation for the next question for example.

If your application has all the questions embedded in the project (offline), you can, for example, create an Object Array and, with each question answered, refresh the screen with the next question, storing the user's response in a Separate array.

If on the other hand your application has the questions online (from a webservice / API), with each question answered you ask the next question to the server and store the user's response, also in an Array.

    
30.12.2014 / 13:58