The Map Demo (Assignment 2)


The purpose of this assignment is to give you experience using Eclipse to develop a simple Android application that displays a map given a pair of latitude and longitude coordinates. The application works as follows:

Note that the results will look somewhat different if you use a real Android smartphone vs. using the AVD emulator shown in the screenshots above.

Program Description

This assignment involves writing an Android program that has the following features:

The entire layout of the application must be structured by the contents of the Android resource files described via XML, i.e., you must not hard-code any TextView, EditText, or Button objects into your MapDemoActivity class.

All the lifecycle events associated with your MapDemoActivity class must be logged to LogCat via the Log.d() method, e.g.:

08-26 20:27:48.580: D/MapDemo(3323): onCreate()
08-26 20:27:48.610: D/MapDemo(3323): onStart()
08-26 20:27:48.610: D/MapDemo(3323): onResume()

Your MapDemoActivity class should inherit from a parent class called LifecycleLoggingActivity that defines the associated hook methods to perform this logging, as follows: public class LifecycleLoggingActivity extends Activity { public void onCreate(Bundle savedInstanceState) { /* you fill in here. */ } public void onRestart() { /* you fill in here. */ } public void onStart() { /* you fill in here. */ } public void onResume() { /* you fill in here. */ } public void onPause() { /* you fill in here. */ } public void onStop() { /* you fill in here. */ } public void onDestroy() { /* you fill in here. */ } }

Concluding Remarks

Information useful for learning how to write this application is available in the the Busy Coder's Guide to Android Development textbook. I recommend you read this material and work through the various tutorials.

If you find it extremely hard to complete this assignment you may not be ready to take this class. If this is the case, I recommend you take the Intermediate Software Design course (CS 251) first since it focuses on the patterns and tactics of effective OO design and programming.

Back to CS 282 home page.