Practical tasks to perform and ensure that the basis of the chapter has been understood.
The assignment is mandatory for a passing grade in the course.
Create an application for adding numbers and calculate a total, similar to a counter application but somewhat extended. It must contain the following.
Create six buttons with the following values: 1, 2, 5, 10, 20, 50.
Show a total somewhere in the user interface using a TextView.
When the user presses any of the six buttons, its corresponding value should be added to the current total and displayed in the TextView.
Add a button called "Reset" that sets the current total to zero and displays it in the user interface.
Add a button called "Undo" that subtracts the lastly added value to the total and displays the new current total. You only have to support undoing one addition, the very last addition. Store the added value from the first six buttons in a class member variable so you will know how much to subtract when the Undo button is pressed.
Perform this optional assignment to get one (1) extra credit.
Create an application for preparing to send a sms message. It must contain the following.
Three buttons with predefined texts like "I'll be late", "Meet me at the usual location" and "I'm here. Waiting outside for you".
Three buttons with "Send to" and a name on them, like "Send to Alice", "Send to Bob" and "Send to Cathy".
The main function of your app will be that the user is supposed to press one of the first three message buttons to select a text and then press one of the three name buttons to send that text as an sms message to the chosen recipient. Or rather, prepare to send by starting the system Actvity for sending sms messages with the chosen text and recipient prepared.
You'll need to remember the chosen text in a member variable in your Activity class so you can retrieve it when you respond to the onClick for one of the name buttons.
You'll also need to decide what phone numbers Alice, Bob and Cathy has. This will be coded into the application and does not need to be changable in any way.