Algorithms and OOD (CSC 207 2013F) : Labs
Primary: [Front Door] [Schedule] - [Academic Honesty] [Disabilities] [Email] [FAQ] [IRC] [Teaching & Learning]
Current: [Assignment] [EBoard] [Lab] [Outline] [Partners] [Reading]
Sections: [Assignments] [EBoards] [Examples] [Handouts] [Labs] [Outlines] [Partners] [Readings]
Reference: [Java 7 API] [Java Code Conventions]
Related Courses: [CSC 152 2006S (Rebelsky)] [CSC 207 2013S (Walker)] [CSC 207 2011S (Weinman)]
Misc: [SamR] [Glimmer Labs] [CS@Grinnell] [Grinnell] [Issue Tracker (Course)] [Issue Tracker (Textbook)]
In this laboratory you will learn how to create more activities, and link them together in a cohesive app.
Make sure you've completed and understood the reading on adding activities to android apps. You will find it useful to have it open in another window or tab.
a. Add a new activity to the Android project you've created in the previous lab.
b. With the tools you already have, make the Activity look and do something interesting. For example you can find more meowing sounds that the cat makes on different occasions (for example if it's hungry, mad, or sleepy). If you're feeling creative, you can add some information about it, and display it as a list.
a. Add a Button to our main activity
b. Add the onClick qualifier to your new button, and decide on a method name that links lets the Button go to our other activity.
c. Implement the method you've given to your Button with a new Intent
a. Enable the Action Bar to display the back arrow
b. Override the onCreateItemSelected
method by
giving it a new Intent
that takes us back to our main activity
Run the app on your device to make sure everything is working correctly
a. Add a ListView to your activity
b. Create a new xml file that defines the rows' TextView
c. Create a list of possible pet names for your cat and feed it to the ListView via the Adapter
Primary: [Front Door] [Schedule] - [Academic Honesty] [Disabilities] [Email] [FAQ] [IRC] [Teaching & Learning]
Current: [Assignment] [EBoard] [Lab] [Outline] [Partners] [Reading]
Sections: [Assignments] [EBoards] [Examples] [Handouts] [Labs] [Outlines] [Partners] [Readings]
Reference: [Java 7 API] [Java Code Conventions]
Related Courses: [CSC 152 2006S (Rebelsky)] [CSC 207 2013S (Walker)] [CSC 207 2011S (Weinman)]
Misc: [SamR] [Glimmer Labs] [CS@Grinnell] [Grinnell] [Issue Tracker (Course)] [Issue Tracker (Textbook)]
Copyright (c) 2013 Samuel A. Rebelsky.
This work is licensed under a Creative Commons Attribution 3.0 Unported License. To view a copy of this
license, visit http://creativecommons.org/licenses/by/3.0/
or send a letter to Creative Commons, 543 Howard Street, 5th Floor,
San Francisco, California, 94105, USA.