DOC PREVIEW
SDSU CS 696 - Android Assignments 1- 6

This preview shows page 1 out of 3 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 3 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 3 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CS 696 Mobile Phone Application DevelopmentFall Semester, 2009Assignment© 2009, All Rights Reserved, SDSU & Roger Whitney San Diego State University -- This page last updated 11/1/09Android Assignments 1- 6.We will have a series of assignments to get some experience with some of the basic Android functionality. You maybe tempted to spend a lot of time polishing your interfaces for these ap-plications. While you are welcome to do so, the goal of these assignments is to get experience with the Android API. We will focus on polishing GUIs later in the course.Note: Teams are not allowed on these assignments. You are to do these assignments by yourself. People turning in duplicate code will be treated as having cheated on the as-signment.1. Tip Calculator. Due Sept 25 23:55. Write a tip calculator activity. A User input the percent they wish to tip via a spinner. They type into a text field the amount that they wish to tip on. When they click on a "Calculate" button the amount of the tip and the total amount (tip plus original amount) are displayed. Goal of assignment: create an activities, get some experi-ence using Android views.Grading for Assignment 1Working code that meets the specification90%Quality of Code10%2. Restaurant App. October 2 23:55. The application start screen shows a user sees a listing the of restaurants currently in the database. The list needs to scroll if it does not fit on one screen. The list only displays enough information about each restaurant (name?) so the user can identify it. When a user selects a restaurant, a second activity (restaurant detail view) is called to display all the information about the restaurant. This information includes the res-taurant's name, address and phone number. The application start screen also has a menu item that allows the user add a new restaurant to the list. That menu item brings the user to an activity that allows the user to enter the information for a new restaurant. The information about the restaurants is to be stored in the Android database. Goal of assignment: use mul-tiple activities, pass information between activities, use the Android database, more experi-ence with views.Grading for Assignment 2Working code that meets the specification75%Quality of Code10%Unit tests15%3. Restaurant Map. October 9 23:55. In the restaurant app add a button to the (restaurant de-tail view) that when clicked opens a map view showing the location of the restaurant and the location of the user. Goal of assignment: use the location services and maps. For this as-signment you need to sign up for an android maps API key with Google. See http://code.google.com/android/add-ons/google-apis/mapkey.html for more information.Grading for Assignment 3Working code that meets the specification90%Quality of Code10%4. Restaurant Widget. October 16 23:55. Create a restaurant widget which displays one res-taurant. In your restaurant application restaurant detail view add a display button. When the user clicks the button a broadcast is sent to all running restaurant widgets on the phone to update themselves to display that information. Goal of assignment: learn how to create wid-gets and handle updates.5. Drawing Circle App. October 30 23:55. When the application start up the first screen seen is a bitmap image of your construction. When the user clicks on the screen they go to another screen. Whenever they touch/click on the screen a circle is drawn centered at that location. Goal of assignment: dealing with bitmaps and 2d drawing. 6. Network App. Due Nov 14, 23:55. When the application starts it shows a list of name of pho-tos that can be displayed. When the user clicks on a name the application starts a new activ-ity that displays the photo selected by the user. The application will obtain data from a photo server. The server is "bismarck.sdsu.edu" run-ning on port 8009. The server responds to three commands: list, recent and photo. All commands to the server end in a semicolon. The semicolon is required. It is used by the server to determine the end of your request. The sever closes the connection after re-sponding to each request. So you have to open a new connection to the server for each request. The server returns a JSON array in response to a list or recent command unless there is an error. In case of an error (improper syntax of the request or some other problem) the server will return an error message as non-JSON string. When you try to parse the string as a JSON object you will get a JSONException.The list command returns a list of photos currently on the server. To send the list command open a socket to the server and send the string: list;The semicolon at the end of the command is required. There are no characters after the semicolon. The server will respond with the list of photos in JSON format. The list is a JSON array containing objects. Each object has an id and a name. The name is for display-ing to the user and the id is used to fetch the photo from the server. A sample list response from the server is:[{"id":1,"name":"Cat"},{"id":2,"name":"Dog"}]After returning the string the server closes the connection (which means you can read to the end of file marker.) The photo command returns a single photo from the server. To send the list command open a socket to the server and send the string:photo:3;The semicolon at the end of the command is required. There are no characters after the semicolon. The colon is required. The number after the colon is the id of the photo to be re-turned. The server returns a sequence of bytes that make up the jpeg photo. Do not read the bytes with a reader as it will treat the binary bytes as characters, just use streams. If there is an error the server does not return any bytes, it just closes the connection. After returning the photo the server closes the connection, so you can read until the stream re-turns a -1.The command recent returns all photos posted to the server after a given date. This pro-vides the application a method of finding out what photos were posted after the last time it checked with the server. A sample recent command is:recent:11.2.2009; The format is the string recent followed by a colon, followed by a date, followed by a semi-colon. The format of the date is month (one or two digits) followed by a period, followed by the day of the month (one or two digits), followed by a period, followed by the year (four digits). The server responds with a JSON array with information of


View Full Document

SDSU CS 696 - Android Assignments 1- 6

Download Android Assignments 1- 6
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Android Assignments 1- 6 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Android Assignments 1- 6 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?