CS 185C/286 - Lecture 8

Cay S. Horstmann
Lecture 8 Quiz 1
Put your answer into Piazza.
The first test case in this article starts with a call to getActivity()
. Where is this method defined?
- Elsewhere in the test class
- In
InstrumentationTestRunner
- In
AndroidTestCase
- In
ActivityInstrumentationTestCase2
Lecture 8 Quiz 2
Which of the following is true about MonkeyRunner.
- MonkeyRunner is a unit testing tool.
- MonkeyRunner test cases are written in Java.
- MonkeyRunner can compare a screenshot with an expected one.
- You must run MonkeyRunner from the command line.
Projects

- Modernize Android client for Android 4, including tablets: Keith, Vakati, Wu
- Improve device integration with Android and iPhone client: location, phone, schedule, contacts, etc.: Pham, Li X, Li Y
- HTML5 Cinequest client: Cheung, Nguyen, Yi
- Hemepath counter app: Dang, Eibagi, Karnes
- Samsung S-Pen: Sainion, Sivaraman, Tang
- Port Cinequest app (films only, not schedule) to Windows phone: Anderson, Yulianto, Lehrmann
Today's Lecture/Lab
Project Management

- In software engineering course: requirements, design, implementation, testing
- In 10 weeks, there is no time to do it right
- If you want to build a ship, don't drum up the men to gather wood, divide the work, and give orders. Instead, teach them to yearn for the vast and endless sea. — Antoine de Saint Exupéry (Attributed)
- Inch pebbles, not milestones. They are done or not done.
- Many short meetings
- Research is good, but it should lead to tangible results quickly
- The wiki is your friend
- It is better to ask for forgiveness later than for permission now
Source and Documentation Repository

- Make a github account and let me know what it is
- Use the github wiki
- If you work on Cinequest, just clone the repo
- Everyone checks in all their code
- Everyone makes sure that the code builds on everyone's machine
- ...and on my machine
- There will be unit tests
Weekly Report
- Each team member keeps an individual report on the wiki
- Pretend you are a contractor. Log every hour.
- Just update the Wiki when you are done with a stretch of work
- Team lead keeps a list of each meeting, a list of open issues, a list of inch pebbles
- Meeting: Date/time/anyone missing
- Open issues. Anything that makes you nervous. Cross out closed items (
<del>
in Markdown)
- Inch-pebbles. Add responsible person. Cross out achieved items, add new items.
Lists with buttons etc.
- You can put any components into a list row
- Remember: Have separate layout XML for
ListView
and each row
- Row layout set with adapter
- Row layout can contain any components. Example: Cinequest
listitem_titletimevenue.xml
- But when you have a focusable component (input text field, button, etc) inside, the item clicks no longer work. That's not a bug—not. One remedy:
android:focusable="false"
or maybe android:descendantFocusability="blocksDescendants"
(haven't tried the latter).
- Need to attach listeners in
getView
method. Example: CinequestActivity.ScheduleListAdapter.getView
Sectioned Lists
- Long lists often have separate sections
- Example: A section for each letter, or for each day
- No direct API support, but lots of homegrown approaches
- Here, here, here, here, here
- Cinequest
SeparatedListAdapter
builds upon one of them.
Fast Scrolling
- Enabling (with
android:fastScrollEnabled
) causes "thumb control" to appear next to scrollbar
- Dragging the thumb does fast-scroll. As the thumb traverses the height of the window, all items are shown.
- Need to implement
SectionIndexer
- Shows popup with section name (broken on emulator)
- See this blog
Miscellaneous List Features
Reading Before Next Class

Lab

- Bring your laptop to the lab
- You will work with a buddy
- One of you writes code, the other types up answers
- Switch roles each lab
- Submit lab work to git
No Lab Today
Finish Lab 7 if you haven't already.