Entering a Bill Total

Using the numeric keypad, enter 34.56. Just type 3456—the app will position the cents to the right of the decimal point. If you make a mistake, press the delete (Image) button to erase one rightmost digit at a time. The TextViews under the 15% and the custom tip percentage (18% by default) labels show the tip amount and the total bill for these tip percentages. All the Tip and Total TextViews update each time you enter or delete a digit.

Get Android™ How to Program, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.