Quiz App Question

Discussion in 'Android Hacks and Help' started by travis134, Dec 29, 2009.

  1. travis134
    Offline

    travis134 New Member

    Joined:
    Dec 23, 2009
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    0
    Hello there; currently I'm reading a book intended for the use with Android 1.5 and 1.6 platforms; however I am developing on the 2.0.1 platform.

    So far I am novice at best when it comes to Android development; however I am learning at a steady and fast rate (I use C# and Java regularly)

    Currently I have a sneaking suspicion that I am going about the development of a simple quiz application incorrectly or inefficiently. This is what I've done:

    Using XML Layout files, I have created layouts for the main screen, the about page, and all of the subsequent quiz pages (I have a layout for each page which contains a text view for the question, along with buttons representing all of the possible answers)

    I have made classes for each of the pages of my quiz application (Each question is dedicated to it's own page) and to move to the next page, I simply create an intent to use the next page's class; and then switch the current layout when it has reached the next page's class.

    I am simply using what I've learned from the first few chapters of the book; and I can already see that my quiz application is becoming very rigid and procedural; when ideally I would like it to be object oriented and easily modify-able for future releases.

    Is it standard practice to have all of the layouts and contents of the layouts like this "built in" or am I going about this incorrectly?

    Thank you all very much!
  2. areeda
    Offline

    areeda New Member

    Joined:
    Dec 27, 2009
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    Quiz App

    Like you, I'm fairly new with Android, I've written a couple of application but nothing of production quality yet. So please, take this as a discussion not an answer. I have done on-line testing applications for student pilots.


    I'm not sure if I completely understand your program design. It sounds like you are developing a class for each question at compile time. I would suggest a class for each type of question (true/false, multiple choice, match) and a new object for each question created from the proper class.


    I think you might be missing the runtime method for a TextView setText(CharSequence txt).


    I would probably have an object constructor something like TFQuestion(String q, String t, String f, Boolean ans) that is derived from an abstract base class say Question;


    Where you get the questions is another issue but for testing as a static array could look something like


    Question[] myQs = {


    new TFQuestion("Is joe a dork?","yes", "no", true);


    new MCQuestion("How to improve joe's chances for a date","Hair transplants", "Weight Loss", "Divorce", "?" };


    I hope I understood your question.


    Joe

    ps. I'm having trouble formatting this post. All new lines are being ignored.
    Last edited: Dec 30, 2009
  3. travis134
    Offline

    travis134 New Member

    Joined:
    Dec 23, 2009
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    0
    Wow. This makes a hell of a lot more sense; thanks :)

    Now I'm just experiencing some confusion when it comes to ListViews.

    For my application; the questions have varying numbers of answers. I figured the best way to implement this would be to do the following:

    +LinearLayout
    +-TextView (Question text)
    ++ListView (List of answers)

    I am considering using a sqlite database of three tables to store the information; one table that represents every quiz on the device, one table that represents every question on the device (each contain the id of which quiz they belong to), and a answer table (each contains the id of which question they belong to)

    The list view part is just confusing me right now; I'm trying to follow Google's notepad example since it seems to be almost exactly what I want; however Eclipse doesn't want to open their project files, and unfortunately the tutorial doesn't start from scratch.
Similar Threads
  1. Cow54
    Replies:
    0
    Views:
    444
  2. font10
    Replies:
    0
    Views:
    351
Loading...
Search tags for this page
android app source code quiz
,
android eclipse quiz example
,
android eclipse quiz sample code
,
android quiz application source code
,
create quiz in android code
,

developing a quiz app on android

,
how to create quiz app in eclipse
,

how to edit the quiz question in android eclipse

,

quiz android code

,
quiz android open source tutorial test multiple choice
,
quize application using android sample code
,
sample android code for simple quiz app