Create a Tip Calculator App
In this codelab, you will be writing code for the tip calculator to go with the UI you created in the previous codelab, Create XML layouts for Android.
- The code from the Create XML layouts for Android codelab.
- How to run an Android app from Android Studio in the emulator or on a device.
What you’ll learn
- The basic structure of Android apps.
- How to read in values from the UI into your code and manipulate them.
- How to use view binding instead of
findViewById()to more easily write code that interacts with views.
- How to work with decimal numbers in Kotlin with the
- How to format numbers as currency.
- How to use string parameters to dynamically create strings.
- How to use
Logcatin Android Studio to find problems in your app.
What you’ll build
- A tip calculator app with a working
What you need
- A computer with Android Studio version 4.1 or higher installed.
- Starter code for the
Tip Timeapp that contains the layout for a tip calculator.