CS 185C/286 - Homework 3

In this assignment, you will make a few changes to the Cinequest client.

Work from the copy that you made for lab 6. Do not check in the entire code into your personal repo. Instead, submit a patch that transforms the version that's currently on Github to your solution.

Push the personal repo after you complete each part, with an updated report.txt and an updated hw3.patch in a directory workspace/hw03.

1. Look at the sort method in the Platform interface. That was there because the BlackBerry—may it rest in peace—had a nonstandard sort method. Let's eliminate it. Remove the method from Platform and the classes that implement it (AndroidPlatform, JavaSEPlatform). Someone somewhere must have called it. In your report, tell me how you found out where that method was called. (Hint: Right-click, References → Workspace is your friend.) Then replace any calls with Collections.sort.

2. Look at the createWebConnection method in the Platform interface. That's a more complex method. There is an obsolete Blackberry version that we no longer care about. The Android version uses the DefaultHttpClient that is no longer what one should use. Instead, one should just use the Java SE way. Look at the JavaSEWebConnection class. It delegates to HttpUrlConnection. Just use that class instead of WebConnection. Move the useful methods to a helper class. Remove createWebConnection from the Platform interface.

In your report, summarize your steps.

3. There is a FilmsActivity and a FilmsActivity1. They both have the same comment. Are both needed or can one be eliminated? If they are both needed, update the class comments to better describe their purpose. Otherwise eliminate one.

4. Look at the filmactivity_menu. In which screen is it shown? How do you know?

That menu contains a potentially useful Add item. Does it show up anywhere in the application? Should it?

Depending on your conclusion, either add the required functionality or remove the code that is no longer needed. Describe what you did.

5. Test your patch by cloning the repo again into /tmp and applying it. How did you do that, and how did you conclude that the patch works? (Hint: ant)