Labels

Monday, February 27, 2012

The last post for Chapter 3 (Sudoku - New Game Button)

I have tested all of the feature in Chapter 3 including debug print window.

I have implemented "New Game" and "Exit" button today.
It can pop out "Difficulty" dialog box as the same way as  I did for "About" button. The game is not started since it has only an entry point and it is supposed to print a message on the screen.

2 problems I encountered:

  • It did not show the message "clicked on ... " as the book said.
RESOLVED: They are not printed to standard output. There is a log window in Eclipse
Click Window->ShowView->LogCat
See image below.
  • It did not exit the game by pressing "Exit" button.
Page 56-57 of Hello, Android
In Sudoku2.java


private void startGame(int i) {
    Log.d(TAG, "clicked on " + i); // This prints nothing (?) See LogCat window
    // Start game here 
}


case R.id.exit_button:
finish(); // Did not exit the program (?) 
break;


New Game Dialog is implemented 

LogCat Window for Log.d output
At the end, I would recommend you save the directory (whole package) after each feature worked then start modifying files for the new feature.
In general, there is labeling mechanism in source code control system. I do not know if Eclipse has the feature. If you know, please let me know.

No comments:

Post a Comment