The Rugby Score App

I decided to base my next project on a score app for Rugby Union football using the Court app for guidance. The app has two sets of score buttons, one for Team A and one for Team B. Each set of buttons consists of:

  • + 7 for a Penalty Try
  • + 5 for a Try
  • + 3 for a drop kick
  • + 3 for a penalty
  • + 2 for a conversion (successful kick between posts following a try being scored.
The Rugby Score Calculator.

This was an exercise about creating buttons as “onClick” events in the xml and then creating click handlers in the Java. Everything seemed to go well until I turned my phone into landscape mode – the scores disappeared. The solution, it turned out, was to create two static variables “SCORE_TEAM_A” and “SCORE_TEAM_B” the capitals to show that they were static when the user user interface refreshed, and to write two pieces of code – one to onSaveInstanceState to save the scores in those static variables and another to onRestoreInstanceState to show the scores in the refreshed page. It seemed to go well after I had got over that little problem so I submitted to the project and moved onto learning how to add other functionality. During the course all of the learners were linked by Udacity message boards with a general chat room and a chat room for each of the projects.

I will entertain you with the next instalment very soon. ‘Bye for now.

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s