1. Check out our companion app, Forums for Android! Download from Google Play

Best way to code a Quiz Application

Discussion in 'Application Requests' started by _faith_, Jan 14, 2013.

  1. _faith_

    _faith_ New Member
    Thread Starter

    Jan 14, 2013
    Hi I'm new to these forums and sort of new to android development. I want to create a quiz application with a main screen, and a quiz screen with 3 controls

    I took a java intro course, and studied android myself. This is my second year into computer science at the U of Mn

    Main screen =
    1. new quiz
    2. high scores
    3. contact/misc info

    New quiz -> quiz screens that starts with questions.
    1. choose multiple choice questions with 5 choices. If choose correct display green button, otherwise, display red button
    2. can keep picking answers it until you figure out the right answer
    3. next question
    4. return to menu(may be unnecessary because of back button?)

    Here is a picture of my idea
    |****what is 1 + 1
    |a. 1
    |b. 2
    |c. 3
    |d. 4
    |e. 5

    you can picking answers until it tells you when you get it right. (its a learning application)

    and it would choose 24 questions arbitrarily from a pool of lets say 100. After the last question [next] would give you your score out of 24, then let you go back to main menu.

    Whats a good way to think about designing this in terms of activities, intents, and the xml layouts that come with. I understand how very simple android programs work, but since there is a going to be a multitude of choices, would i need seperate activities for each correct/incorrect answer choice?

    If someone can draw me a diagram of the like the first 4 questions, and how they transition into each activity that would be awesome!!!!

    thanks in advance and please any help would be greatly appreciated.


  2. Digital Controller

    Digital Controller The Real Bass Creator

    Sep 5, 2012
    Civil Engineer
    Cincinnati, Ohio
    I have moved this thread into Application Requests as it sounds like you are kind of requesting someone to assist you with this app.

    Hope this helps :)
  3. dlhavema

    dlhavema Well-Known Member

    Sep 27, 2011
    Software Developer
    you'll want a few different activities:

    main - menu and buttons/links to about, help, etc..

    quiz - shows a given question of a set quiz. can be setup to have room for the question and then a ListView of answers. when a user clicks on an answer it is validated, a toast ( or other popup ) appears and shows them if they are right or wrong, and the next question pops up.

    contact/info - is this for you or for them?

    Some supporting features would be:
    a way to add new questions to the set ( server, xml file, etc.. )
    group the questions ( easy math, algebra, definitions, etc. )
  4. rexes

    rexes Member

    Sep 6, 2011
    You will also need a database system at the background to make your work easier!
  5. prl91

    prl91 Active Member

    Jun 14, 2011
    You should only need one activity. I would recommend just creating a different XML layout for static pages such as your help page and contact page, and then switching to those by calling them with a onclick receiver. You shouldn't need any global or local broadcast receivers or intents either, except for the onclick. That will just slow your app down. Not by a lot, but coding for performance early on will help you get into the mind set for future development, where it may be more important.
  6. sohguanh

    sohguanh Well-Known Member

    Generally there are two kind of UI. Developers more familiar with HTML5,Javascript etc will go for webview and phonegap to access android specific like notification,camera etc. Others do the native traditional way.

    As for database, it depends, some apps need to interface with server so database will reside in server instead of the local app database. However for performance, some data maybe cached in local app database when say internet connectivity is not available. Once available sync the local app data to the server.
  7. StevenHu

    StevenHu Well-Known Member

    Feb 8, 2011
    Orange County
    You'll need to be able to save the number of answers right and wrong, and number of questions in a database or localStorage if you want to give them back later.

    You can make the answers as easily as a simple alert popup, so they are coded right into an HTML page (using PhoneGap, for instance).

Share This Page