Android Developer and Instructor at Big Nerd Ranch
Bryan Sills is an Android developer and instructor at Big Nerd Ranch, as well as the lead author of the 5th edition of Android Programming The Big Nerd Ranch Guide. He enjoys breaking down complex topics into teachable bites. He is an avid Chicago music fan and is often spotted biking around the city.
Compose for Desktop
Ask any Android developer about the future of Android and they will probably mention two things: Jetpack Compose and Kotlin Multiplatform. Jetpack Compose is the modern, declarative framework that will power the next generation of Android apps, and Kotlin Multiplatform allows developers to build functionality that can be deployed to many different platforms such as iOS, web, and desktop.
Compose for Desktop takes those two things and brings them together. It allows developers to take their existing knowledge of Android development and quickly build desktop applications. By sharing code between platforms, developers can easily create new features for users on both Android and desktop.
This Code Lab will give the audience experience porting a simple Android app written in Jetpack Compose to run on desktop using Compose for Desktop. The audience will learn about the functionality that Compose for Desktop carries over from Jetpack Compose, as well as the specific considerations that they will need to think about when sharing code between platforms.
Introduction to Context Receivers
You can only call suspending functions from within the scope of a coroutine, but you can only invoke functions from within specific composition contexts.
With the new context receivers functionality in Kotlin, you gain another tool with which you can safely and concisely build new functionality in your app.
At the end of this Code Lab, you will have some hands-on experience using context receivers and an understanding of the specific scenarios in which they might be useful.
The examples presented here won't drive you to rewrite your entire codebase, but they might help inspire your next generation of Kotlin libraries.