Android Development Pre-requisites Coroutines MotionLayout Using Hilt in your Android App Learn the more advanced techniques of building Android apps using libraries, testing, Jetpack and more to increase the quality of your app • Finished the First Two Tracks Curriculum used Advanced WorkManager Advanced Testing : Survey of Testing Topics Jetpack Compose Basics
will you learn? 2 3 1 Coroutines MotionLayout (1 hour) (1 hour) Coroutines are a Kotlin feature that converts async callbacks for long-running tasks, such as database or network access, into sequential code. MotionLayout is a library that lets you add rich motion into your Android app. Modern Android Development Using Hilt in your Android Apps (1 hour) Learn the importance of dependency injection (DI) to create a solid and extensible application that scales to large projects. We'll use Hilt as the DI tool to manage dependencies.
Advanced Testing: Survey of Topics Learn Coroutines, Room, Databinding and End-to-End Testing. 6 Jetpack Compose Basics Learn Coroutines, Room, Databinding and End-to-End Testing. 4 Advanced WorkManager (1 hour) Teaches advanced WorkManager concepts. It builds on the basic material covered in the Background Work with WorkManager codelab. What will you learn? Modern Android Development (2 hour) (1 hour)
DATE Intro Coroutine Sept 22 Return on Coroutine and intro to MotionLayout Sept 29 Return on MotionLayout and intro Using Hilt in your Android Apps Oct 6 Return on Hilt and intro to Advanced WorkManager Oct 13 Return on Advanced WorkMananger and intro to Advanced Testing: Survey of Topics Oct 20 Return on Advanced Testing and intro to Jetpack Compose Basics Oct 27 Return on Jetpack Compose Basics and thank you Nov 3 Android study Jam Schedule
Objectives ० Understand how to use coroutine. ० Use suspend functions to make async code sequential. ० Use launch and runBlocking to control how code executes. ० Learn techniques to convert existing APIs to coroutines using suspendCoroutine. ० Use coroutines with Architecture Components. ० Learn best practices for testing coroutines.
Familiarity with the Architecture Components ViewModel, LiveData, Repository, and Room. ० Experience with Kotlin syntax, including extension functions and lambdas. ० A basic understanding of using threads on Android, including the main thread, background threads, and callbacks. ० Android Studio 4.1 Prerequisites
word “coroutine” is composed of two words: “co” (cooperative) and “routines” (functions). Coroutines are functions that are cooperative. Source : https://www.educative.io/edpresso/what-is-a-coroutine
are functions non-cooperative? Source : https://www.educative.io/edpresso/what-is-a-coroutine Usually, when a function calls a second function, the first cannot continue until the second function finishes and returns to where it was called.
can functions cooperate with one another? Coroutines are functions where the control is transferred from one function to the other function in a way that the exit point from the first function and the entry point to the second function are remembered – without changing the context. Source : https://www.educative.io/edpresso/what-is-a-coroutine
Async callback networkRequest { result -> // Successful network request databaseSave(result) { row-> } } // The same code with coroutine val result = networkRequest() // Successful network request databaseSave(result) // Result saved SEQUENTIAL ASYNC
you’ll do • Use suspend functions to make async code sequential • Use launch and runBlocking to control how code executes. • Convert APIs to coroutines using suspendCoroutine • Best practices for testing
of Coroutines ० suspend ० Coroutine inside a viewModel ० Main Safe ० Cancel all coroutines in viewModel ० Coroutine with WorkManager ० Higher order function ० Moving callback to coroutine ० Testing
to learn more about coroutine? • Check out the " Advanced Coroutines with Kotlin Flow and LiveData" codelab to learn more advanced coroutines usage on Android. • Cancellation and exceptions : Part 1: Coroutines, Part 2: Cancellation in coroutines, and Part 3: Exceptions in coroutines. • Coroutine guides by JetBrains • "Improve app performance with Kotlin coroutines" for more usage patterns of coroutines on Android. • WorkManager Version 1.0
to learn more? • Official Android Developers Site: https://developer.android.com/ • Android Samples on GitHub • Official Android Developers Blog (for announcements) • Android Developers Medium Blog (for more technical articles) • Android Developers YouTube channel • Follow @AndroidDev on Twitter • Subscribe to the Android Developer Newsletter • Official Kotlin language site Version 1.0