Table of Contents

Android Basics with Compose

Android Basics with Compose an online course by Google

Unit 1: Your first Android app

Pathway 1: Introduction to programming in Kotlin

https://developer.android.com/courses/pathways/android-basics-compose-unit-1-pathway-1

1. Before you begin

2. Welcome to Android Basics with Compose

…

3. Your first program in Kotlin

fun main() {
    println("Hello, world!")
}

4. Create and use variables in Kotlin

val count: Int = 2

Type inference:

val count = 2

If you need to update the value of a variable, declare the variable with the Kotlin keyword var, instead of val:

var cartTotal = 0
cartTotal = 20
println("Total: $cartTotal")
fun main() {
    val numberOfPhotos = 100
    val photosDeleted = 10
    println("$numberOfPhotos photos")
    println("$photosDeleted photos deleted")
    println("${numberOfPhotos - photosDeleted} photos left")
}

5. Create and use functions in Kotlin

By default, if you don't specify a return type, the default return type is Unit. Unit means the function doesn't return a value (equivalent of void in other languages).

Any function that doesn't return a value implicitly returns Unit.

birthdayGreeting(name="Rex", age=2)
// the same:
birthdayGreeting(age=2, name="Rex")
fun birthdayGreeting(name:String="Rex", age:Int): String {
  // function body here...
}
 
// call function with two parameters
birthdayGreeting("Rex", 2)
 
// call function with only one parameter, but delivers the same result:
birthdayGreeting(age=2)

6. Practice Problems: Kotlin Basics

…

More Kotlin exercises can be found in Kotlin Core track by JetBrains Academy.

7. What's next

(Optional video)

Pathway 2: Setup Android Studio

https://developer.android.com/courses/pathways/android-basics-compose-unit-1-pathway-2

1. Introduction to Android Studio

…

2. Download and install Android Studio

…

3. Create your first Android app

…

…

4. Run your first app on the Android Emulator

…

5. How to connect your Android device

…

Pathway 3. Build a basic layout

https://developer.android.com/courses/pathways/android-basics-compose-unit-1-pathway-3

1. Intro to Jetpack Compose

(Optional video)

2. Design a birthday card app

(Optional video)

3. Build a simple app with text composables

https://developer.android.com/codelabs/basic-android-kotlin-compose-text-composables

…

…

…

Row(
    content = {
        Text("Some text")
        Text("Some more text")
    }
)

// the same in trailing lambda syntax:
Row {
    Text("Some text")
    Text("Some more text")
}

…

4. Add images to your Android app

https://developer.android.com/codelabs/basic-android-kotlin-compose-add-images?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-1-pathway-3%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-add-images#9

…

5. Practice: Compose Basics

…

6. Project: Create a business card app

…

Unit 2: Building app UI

https://developer.android.com/courses/android-basics-compose/unit-2

Unit 3: Display lists and use Material Design

https://developer.android.com/courses/android-basics-compose/unit-3

Unit 4: Navigation and app architecture

…

Unit 5: Connect to the internet

…

Unit 6: Data persistence

…

Unit 7: WorkManager

…

Unit 8: Views and Compose

…