Introduction to Kotlin and Android Development

Maximiliano Firtman

Maximiliano Firtman

Independent Consultant
5 hours, 32 minutes CC
Introduction to Kotlin and Android Development

Course Description

Developing Android apps was always challenging, but now we have Kotlin and Jetpack Compose to make development smoother. In this course, we will make an App from scratch, learn Kotlin, create the user interface, connect it with data, and make a bridge to the web. By the end of the course, you'll be able to publish and compile your App for Android and the Google Play Store.

This course and others like it are available as part of our Frontend Masters video subscription.

Preview
Close

Course Details

Published: June 23, 2022

Learn Straight from the Experts Who Shape the Modern Web

Your Path to Senior Developer and Beyond
  • 200+ In-depth courses
  • 18 Learning Paths
  • Industry Leading Experts
  • Live Interactive Workshops
Get Unlimited Access Now

Table of Contents

Introduction

Section Duration: 44 minutes
  • Introduction
    Maximiliano Firtman introduces the course by providing some personal background with mobile development and discussing an overview of what material will be covered in this course. Prerequisites for this course are also provided in this segment.
  • Android Overview
    Maximiliano walks through the layers of the Android operating system and which parts will be utilized in this course. An Android application should contain an APK, a ZIP package containing compiled VM code, metadata, assets, and a signature and be installable via the Play Store or USB cable.
  • Android Versioning & APIs
    Maximiliano discusses Android version numbers, code names, and API numbers. SDK versions, including minimum SDK version, target SDK version, and compile SDK version, are also covered in this segment.
  • Kotlin & Architecture Overview
    Maximiliano discusses an overview of Kotlin being open source, statically typed, containing type inference, multi-platform, easy to learn, concise, and null-safety. Kotlin's ability to compile to JVM 6, JVM 8, Android - Java DEX, Native, and Kotlin Multiplatform Mobile is also discussed in this segment.

Basics

Section Duration: 59 minutes
  • Kotlin Basic Expressions
    Maximiliano walks through some basic expressions in Kotlin, including global expressions, variables, booleans, semicolons, printing to the console, correct casing, and conditionals. A student's question regarding using multiple cases is also covered in this segment.
  • Variables & Types
    Maximiliano demonstrates that Kotlin is a statically typed yet flexible language by walking through some variables and types, including mutable and immutable variables, constants, defining types, and core data types.
  • Collections
    Maximiliano discusses collections including mutable and immutable lists, sets, maps, and dictionaries. When talking to the Android SDK sometimes Java arrays are required.
  • Null Safety
    Maximiliano demonstrates the function of Null Safety to distinguish between references that can hold null (nullable references) and those that cannot (non-null references). Kotlin's type system is aimed at eliminating the danger of null references
  • Functions & Lambdas
    Maximiliano walks through creating functions with the fun keyword, inputting arguments, extension functions, and lambda functions. Lambda expressions and anonymous functions are function literals that are not declared but passed immediately as an expression.
  • Classes
    Maximiliano demonstrates how to declare a class with the class name and the optional header and body and discusses constructors. A class in Kotlin can have a primary constructor and one or more secondary constructors.
  • Other Data Types
    Maximiliano discusses other data types including the companion objects attached to classes, sealed classes, enum classes,and data classes.
  • Kotlin Q&A
    Maximiliano answers student questions regarding SDKs compiling to Android and what the function of the triple double quotes are.

Project

Section Duration: 50 minutes
  • Create a Project in Android Studio
    Maximiliano walks through creating a new project using Android Studio, including setting up the application's app store ID. A walk-through of the application preview window is also covered in this segment.
  • Jetpack Compose
    Maximiliano discusses an overview of Jetpack Compose main concepts, including Android activity, theme, composable (UI component), modifier, composition, mutable state, and remember. This segment also briefly discusses the composition local, side effects, dimension units: dp, sp, and graphical assets: PNG and SVG concepts.
  • Composables Layout
    Maximiliano demonstrates how to create a composable to build a user interface by defining a set of composable functions that take in data and emit UI elements.
  • Modifiers
    Maximiliano demonstrates modifiers allow you to decorate or augment a composable, including changing the composable's size, layout, behavior, and appearance. Since each function makes changes to the Modifier returned by the previous function, the sequence affects the final result.
  • TextField & Input Value
    Maximiliano walks through implementing a TextField, using the remember composable to allow a user to input text. A value computed by remember is stored in the Composition during initial composition, and the stored value is returned during recomposition.

UI

Section Duration: 1 hour, 37 minutes
  • Offers Page
    Maximiliano walks through creating the Offers page of the application, including a shortcut to create a Composable and preview, and discusses the purpose of the andriodx imports. Editing the page's text styling and adding auto imports are also covered in this segment.
  • UI Theming
    Maximiliano demonstrates setting the Offers page styles in the theme using MaterialTheme and further styling using modifiers. Setting up custom reusable theme colors in the ui.theme/Color.kt file is also demonstrated in this segment.
  • Adding Background Image
    Maximiliano walks through creating, converting, and importing a vector background image to the Offers page. Modifying the image width and height is also covered in this segment.
  • Preview Composable
    Maximiliano demonstrates creating a private composable just for the preview to allow multiple previews to be viewed at the same time. Implementing a scrollable preview is also covered in this segment.
  • App Title Bar
    Maximiliano walks through rendering the application's title bar by downloading a vector logo and placing it in the correct content position in the Scaffold. Implementing the composables Box and TopAppBar are also covered in this segment.
  • Bottom Bar Navigation
    Maximiliano walks through creating a bottom navigation bar by creating a data class to contain the titles, images, and routes for each navigation option. Styling the alignment, image, and text of the NavBarItem is also covered in this segment.
  • Nav Bar Buttons & State
    Maximiliano demonstrates rendering each navbar item, implementing state, and updating the navigation icon colors when selected. Styling the bottom nav bar with proper padding, background color, and font is also covered in this segment.
  • Creating Pages & Data Model
    Maximiliano walks through creating and implementing navigation for each page when the corresponding icon is selected. A student's question regarding if iterables could be used is also covered in this segment.

Data

Section Duration: 52 minutes

Production

Section Duration: 21 minutes

Wrapping Up

Section Duration: 6 minutes

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now