Android Intro Application

From Cs160-sp08

Jump to: navigation, search

Due: before class on Feb 26, 2008

20 Points



2/24 - There is an error in the sample code provided that prevents you from requesting additional pages of images from flickr. In the FlickrImageLoader class, all instances of the string "&page" should actually read "&page=" (the equal sign is missing). A quick find/replace should fix this in your application.

2/22 - To avoid any confusion - your basic application only needs to be able to search for images by tag, not by user or group name. User/group name search can be added as one of your additional features.


The goal of this assignment is to help you become more familiar with the Android SDK before you begin coding your project idea. In this assignment you will use the Android SDK to develop a simple Flickr photo browser. You will complete this assignment individually and you should not work together while completing it. We will be checking that your code and implementation are unique to you.


Your application should allow a user to browse sets of Flickr images as well as search for images with specific metadata. The assignment requires you to create a UI for photo browsing and a UI for searching for photos and integrate the two. You'll need to implement XML UIs for each of these activities and wire each up using appropriate Java code. You'll also need to handle data passing from the search interface to the browsing one. The Android SDK provides a number of useful layout components, views, and widgets that you may want to use to create your image browser. See the Android view gallery for a visual overview of some of them. As with the final project, you should design your application to only use the buttons on the phone as input, your application should not use the touch screen.

All Android applications need to be designed to handle interruptions. Therefore, you'll need to handle activity lifecycle events so that the program starts and stops gracefully. You must override onPause() and onResume(), and any other relevant lifecycle methods for your Activities so that your application resumes to an appropriate state after an unexpected exit (for example, returning to the Activity after leaving it via the 'Back' or 'Home' key).

Once you have a working version of the application, you should add at least two additional features of your choosing. These might include:

    • support for rotating images
    • support for zooming in and out of images
    • the ability to send an image to a contact
    • the ability to search for photos using human-readable user/group names (not just flickr the machine-readable user/group IDs that the current helper code takes. This may require rewriting or adding to the flickr loader code)
    • the ability to find other images with the same tags as the one you're viewing (may require updating flickr loader code)
    • setting one of the images as emulator wallpaper
    • support for tinting images
    • providing the ability to saving images locally
    • other non-trivial features may also be possible, but you must check them with one of the TAs either by email or at office hours first.

Remember that while some of these features may not be hard to implement, you should carefully consider how they are integrated into your user interface and how users will control them. You should list the features you've added in your documentation.

With respect to design, make sure that your interface is usable. We're not expecting you to do extensive iterative design and formal user testing, but it's good to show your app to at least one person outside the group.

Getting Started

We have provided code to help handle the loading of Flickr images. However, you'll need to obtain your own Flickr API key in order to use it. Flickr users can request an API key here. If you don't already have one you'll need to get a Flickr account first.

You can download the provided code here. Create a new Android project in Eclipse and select 'Create project from existing source'. Warning: adding the source via 'Import...' may not work.

The code we've provided is a sample Android project containing a helper class,, which encapsulates the process of requesting and obtaining URLs for Flickr images. It also contains an Activity, '' that demonstrates how to load a single image indicated by one of these URLs and display it in Android. It's up to you to figure out how to do this for multiple images and how to provide a user interface that allows a user to search for images by tag. You should feel free to alter or extend any of the code we've provided.

Additional information on Android and how to get up and running is available on the Getting Started with Android page. Another good way to start is by looking at the example applications included in the Android SDK.


You will submit the following:

  • 2-3 Screenshots of the application. These should include each of your layouts and Activities in action.
  • A .zip file containing your Android project.
  • a readme file with:
    • your name
    • instructions for building and running the code. E.g. - which Activity to launch. Also, is there anything we need to configure outside of the standard Android package.
    • a list of additional features added
    • any issues or comments.

Link your files as described below.

Note: We will be testing your application with the Android SDK M5 (the new SDK); thus, you should write your code using the new SDK. If you write it using the old SDK, it will not work.

Grading Guidelines

Functional Requirements (15 Points)

  • An Activity with a UI that allows you to browse sets of 10+ Flickr images (5 points).
  • Provide a second Activity that allows users to search for images with specific tags and then display them in your browsing Activity (3 points).
  • Handle activity lifecycle appropriately (3 points).
  • 2 Additional features (4 points).
  • (We will grant additional 1 additional extra-credit point - up to 5 - for each additional feature after 2).

A precondition for any points in this part of the grade is code that compiles and runs. :)

Comments (1 Points)

Please document your code!

Design (4 Points)

Remember, we'll be approaching your interface as new users (and you won't be there to tell us what to do!). So keep good design principles in mind when laying out GUI. It doesn't have to be perfect, but remember to try your interface with some users to make sure it's reasonable.

Android Tips

  • For examples of how to use the various Widgets, we highly recommend importing and examining the ApiDemos project that you will find in the samples/ directory of the Android SDK.
  • Look through the List of Views in the Android reference area before choosing how you want to implement your UI.


Creating a Wiki Page for this assignment

Begin by creating a new wiki page for this assignment. Go to your user page that you created when you made your account. You can get to it by typing the following URL into your browser:

Replace FirstName and LastName with your real first and last names. This will take you to the page you created for yourself when you created your wiki account. If you have trouble accessing this page, please check that you created your wiki account properly.

Edit your user page to add a link to a new wiki page for this assignment. The wiki syntax should look like this:


Again replace FirstName and LastName with your name. Look at my user page for an example. Then click on the link and enter the information about your assignment. Be sure to clearly address everything mentioned in the writing guidlines above.

Uploading Images

To upload images to the wiki, first create a link for the image of the form [[Image:image_name.jpg]] (replacing image_name.jpg with a unique image name for use by the server). This will create a link you can follow that will then allow you to upload the image. Alternatively, you can use the "Upload file" link in the toolbox to upload the image first, and then subsequently create a link to it on your wiki page.

Add Link to Your Finished Assignment

One you are finished editing the page, add a link to it here with your full name as the link text. The wiki syntax will look like this: *[[AndroidApplication-FirstNameLastName|FirstName LastName]]. Hit the edit button for this section to see how I created the link for my name.

[add comment]
Personal tools