Get user input in an app: Part 1

Create a tip calculator app by building the layout first, then implement the logic to calculate the tip from the user input.

 

Welcome to Unit 2: Layouts

Video Optional

Learn about the two apps you’ll build in this unit to advance your knowledge about UI layouts in Android.

Tip calculator app introduction

Video Optional

Get a glimpse of the tip calculator app you’ll be building in this pathway.

Classes and inheritance in Kotlin

Codelab

To build more complex apps, you’ll need to better understand how classes and inheritance work so that you can more fully use what the Android platform offers.

Create XML layouts for Android

Codelab

Learn about new UI components, such as editable text fields, radio buttons, and switches to build up the layout for your tip calculator app. Instead of using the Layout Editor in Android Studio, you’ll be editing the layout for your app in XML.

Calculate the tip

Codelab

Learn how to write Kotlin code to interact with the UI elements in the tip calculator app, so that you can calculate the tip. You’ll also learn how to handle edge cases in your app to make your app more robust.