Coding Lab

In preparation for the lab, please go through the guide to get started with Android, in particular the part about emulating GPS.

Lab

Create a new Android project on Eclipse from the NotePad code sample. Run NotePad to become familiar with the app.
You will enhance NotePad to keep track of the location where the note was created.

1-      In EditNote, add a menu option to associate a location with the note.
You should not change neither of onCreateOptionsMenu or onPrepareOptionsMenu methods
.

Hint: Consider modifying the manifest.

2-      Associate an Intent with the menu option created in (1), and create a new activity AddLocation that will process that Intent.

Hint: Read about intents at http://developer.android.com/guide/topics/intents/intents-filters.html.

3-      Create a new service CheckZone, so that it includes constant definitions of a few zones defined as a triplet: (name, gps1, gps2).
The two pairs of GPS coordinates represent two opposite corners of a rectangle corresponding to the named geographical zone.
Provide one method that given a pair of coordinates, checks if it falls within one of the defined zones, and returns the name of zone or null.

Hint: Read about local services in http://developer.android.com/reference/android/app/Service.html

4-   Have AddLocation get the present (emulated) GPS coordinates, and then invoke CheckZone as a local service.
Make sure to test this feature by pushing different coordinates onto the emulator.

5-   Associate a floating window layout with AddLocation (similar to EditTitle) with a field where users may update the zone name, if one was associated in (4), or enter a new location name specifically for the note (not to be stored elsewhere).
As done with EditTitle, use the res.values.strings.xml file to store any labels that appear in the window for AddLocation.

6-   Add the note’s location name to the NotePadProvider, so that it gets saved into SQLite.

Hint: Read about content providers http://developer.android.com/guide/topics/providers/content-providers.html

7-      Change the layout in NotesList so that the location name appears to the right of each note title - truncate the view of the title, if needed.

Hint: This can be done without using Relative Layouts. You may need to completely rewrite the NoteList layout. 

 

 

When you’re done, please submit a zip file on Blackboard containing

- your source code,

- screen snapshots of the features you developed, and

- a self-assessment note: how well did you do on each of the 7 items above. If you had no trouble, just say that.

You may resubmit at any time before the due date.