Sunday, January 10, 2010

And now, for my first trick

Rather than dryly read through AWAD Chapter 6, I think I'll come up with an example that applies some of the concepts contained therein. As I was flipping through the pages, I noticed the Chronometer and toggle button widgets. That gave me the idea to develop a simple chess clock. I've got two things going against me at the moment -- I've never written a single program in Java and this is my first non-trivial (to me!) Android app.

With that in mind, let's get the requirements out of the way:

  1. The Chess Clock will be set up for two players.
  2. It will have two analog clock graphics that count-down in time as well as textural or similar digital counterparts. Want 3 hands on the clock: hour, minute, and seconds.
  3. There will be two buttons displayed underneath each analog clock.
  4. When a button is on, the corresponding clock will count-down.
  5. A button can go from on -> off state, but not the other way. This simulates player 1 hitting "done!" on his button and automatically activating player 2's clock. The button itself should say "done!" or "stop!" to indicate the activity that occurs when the player presses it (exact text TBD).
  6. Overall game time should be displayed in digital form, defaulting to 30 minutes but configurable through some means (changing game time method is TBD). Each player will then have game time / 2 assigned to them at the beginning of the game (therefore 30 minutes = 15 minutes a piece).
  7. Display a graphic next to each clock giving another indicator of which player is active: use a green circle indicating that player is "active" and a red circle if that player is "inactive". Alternately, use a button that indicates this. Exact method TBD.
  8. Make provisions that allow for sound alerts to be activated when 5 minutes, 1 minute, 30 seconds, and 10,9,8,... 1 countdown.
  9. Need a method to reset the clocks, but also need to prevent reset from accidentally being hit.
  10. Clock should somehow override the power-saving / blanking feature of the phone.
  11. Verify interrupted operation. Clocks should suspend when this occurs.

No comments:

Post a Comment