You are on page 1of 8

Android Course

Lab 2: Notepad application

M.Sc. Bui Tan Loc btloc@fit.hcmus.edu.vn

Department of Software Engineering, Faculty of Information Technology, University of Science Ho Chi Minh City, Viet Nam
.

2011 University of Science HCM City

Android Course

Pre-requirements

Module 4: User Interfaces - Activity

2011 University of Science HCM City

Android Course

Notepad Exercise 1

Do the tutorial for exercise 1: After



d-ex1.html

http://developer.android.com/resources/tutorials/notepad/notepa
complete this tutorial, you will have practiced
notepad_list.xml,

about:

Creating

xml-based layout files such as notes_row.xml. Modifying string.xml resource. Creating options menu by using code. Handling options menu selections. Creating and loading resources for a ListView. Filling data into a ListView.

2011 University of Science HCM City

Android Course

Notepad Exercise 2

Do the tutorial for exercise 2:

http://developer.android.com/resources/tutorials/notepad/notepa
d-ex2.html

After

about:

complete this tutorial, you will have practiced

Creating context menu by using code. Handling context menu selections. Using Intent object to start an activity for a result. Starting an activity for passing values by putting values into Intent

object. Using layout_weight attribute. Loading views from xml-based layout file by using findViewById() method. Using Intent object to read passed values. Using event listeners. Declaring a new activity in AndroidManifest.xml file.
.

2011 University of Science HCM City

Android Course

Notepad Exercise 3

Do the tutorial for exercise 3: After


d-ex3.html

http://developer.android.com/resources/tutorials/notepad/notepa
complete this tutorial, you will have practiced
onPause(),

about:

Managing

the Activity lifecycle with onCreate(), onResume(), and onSaveInstancesState() method.

2011 University of Science HCM City

Android Course

Notepad Extra Credit

Do the tutorial:

http://developer.android.com/resources/tutorials/notepad/notepa
d-extra-credit.html
Practiced about using DMMS tools to emulate voice calls or SMS messages. Learned about the time which onCreate(), onPause(), onResume(), or onSaveInstancesState() method is called.

After complete this tutorial, you will have:

2011 University of Science HCM City

Android Course

More requirements

Try

creating menus by loading from xml resources (not using code to create menu items). Try adding icons (images) for menu items. Try using event listener technique for menu item selections (not using onOptionsItemSelected or onContextItemSelected function)

2011 University of Science HCM City

Android Course

Questions or Discussions

Why

do we not use onRestoreInstancesState() to manage the Activity lifecycle in this Notepad application? What is the difference between using event handlers (onOptionsItemSelected, onContextItemSelected) and using event listeners (setOnMenuItemClickListener)?

2011 University of Science HCM City

You might also like