CS 185C/286 - Homework 2

Your task is to write an Android application that reads a quiz in XML form from here, parses it with a SAX parser, and displays a list of questions to the user. When the user taps a question, show a screen with the question and the choices. When the user selects a choice, return to the first screen, in which correctly answered questions are colored green, incorrect ones red.

Tapping previously answered questions has no effect.

You check in a project that solves the assignment together with a report in a file report.txt. Use plain text, not Word or RTF, or you won't get credit for the report. Make sure that report.txt is in the workspace/hw02 directory.

You can reuse any part of your or my homework 1 solution, as well as any lab work.

In the report, answer the questions given in the step-by-step instructions below.

  1. Make a new project with name Homework 2 in the package edu.sjsu.cs185c.hw02 Be sure to set the app package to the same, and set the app name in strings.xml to Homework 2. The entry point of your program must be called MainActivity (which means that you'll need to rename what has been the main activity up to this point).
  2. Generate build.xml.
  3. Describe your strategy for parsing the XML. What will you do with each event?
  4. Get the parsing done and show the list of questions. Commit and push your git repo. Paste the terminal contents from the push into your report.
  5. Implement the listener for touching a question. Show all choices, either as in homework 1 or as a list—your choice. Push your repo. Paste the terminal contents from the push into your report.
  6. Describe your strategy for showing the list with red and green colors. How will it know how to color? How will you disable touch for answered questions?
  7. Complete your program, commit and push your git repo.