Date Posted

Advanced Java and Android Material

7/22/2013 Slides for Day 1 Introduction
Slides for Day 1 Objects refresher
Slides for Day 1 Swing Programming
KiloConverter V2 program source (main)
KiloConverter V2 program source (window)
7/23/2013 Slides for Day 2 Swing and Graphics
DirectorySize Program
Bouncing Ball App
Bouncing Ball Controller
Bouncing Ball
Android Pong (PaddleBall) Game Project (zip)
7/24/2013 Multithreaded Account Program
Multithreaded Print Demo
7/25/2013 Android Demo Application from Tutorials
Accelerometer Test
7/26/2013 Two-Player Pong, version 1
Two-Player Pong, version 4 source only, with multi-touch
Accelerometer Program displaying in a drawable view
7/28/2013

A final note:  It has been a real pleasure teaching this class.  I trust you learned much and got ideas for future apps, and learned enough Java Swing to be able to explore on your own.  Have fun and be fearless.

Logging Code
/** Show an event in the LogCat view, for debugging */
private void dumpEvent(MotionEvent event) {
String names[] = { "DOWN" , "UP" , "MOVE" , "CANCEL" , "OUTSIDE" ,
"POINTER_DOWN" , "POINTER_UP" , "7?" , "8?" , "9?" };
StringBuilder sb = new StringBuilder();
int action = event.getAction();
int actionCode = action & MotionEvent.ACTION_MASK;
sb.append("event ACTION_" ).append(names[actionCode]);
if (actionCode == MotionEvent.ACTION_POINTER_DOWN
|| actionCode == MotionEvent.ACTION_POINTER_UP) {
sb.append("(pid " ).append(
action >> MotionEvent.ACTION_POINTER_ID_SHIFT);
sb.append(")" );
}
sb.append("[" );
for (int i = 0; i < event.getPointerCount(); i++) {
sb.append("#" ).append(i);
sb.append("(pid " ).append(event.getPointerId(i));
sb.append(")=" ).append((int) event.getX(i));
sb.append("," ).append((int) event.getY(i));
if (i + 1 < event.getPointerCount())
sb.append(";" );
}
sb.append("]" );
Log.d(TAG, sb.toString());
}