Google is committed to advancing racial equity for Black communities. See how.

Get user input in an app

Create a tip calculator app by building the layout first, then implement the logic to calculate the tip from the user input. You’ll finish by adding polish to the app to create an even better user experience.

 

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.

Change the app theme

Codelab

Choose colors for your app and apply them consistently throughout your app using themes.

Change the app icon

Codelab

Change the launcher icon for your app with the help of the Image Asset Studio tool in Android Studio.

Create a more polished user experience

Codelab

Update your tip calculator app to look more professional and polished by following Material Design guidelines and best practices for UI development.

Quiz

Test your knowledge of class inheritance, layouts in XML, and the Gradle build system, and earn your Get User Input in an App badge.