Every app in Cordova to Capacitor was, at heart, a web app. Cordova 129 and Capacitor 243,123 put your HTML, CSS and JavaScript in a WebView and reached the phone's hardware through a plugin bridge; Framework7 572,986 made those web pages look and feel native; React Native 36,878 swapped the WebView for real native widgets but still ran your logic in a JavaScript engine. This chapter removes the last layer of translation. You write the app in Kotlin, the language Google recommends for Android, and draw its screens with Jetpack Compose 234 , Android's declarative UI toolkit. The compiler turns your code into the same DEX bytecode that Android's own apps run, and every Android API is a direct call away.
That power comes with a new language to learn, so the chapter starts there. Kotlin for JS Developers to Coroutines and Flow teach Kotlin to someone who already writes JavaScript and TypeScript: variables and types, null safety, functions and lambdas, classes and data classes, sealed classes, extension functions and generics, collections, and finally coroutines and Flow, Kotlin's answer to promises and async iteration. Each idiom is set beside its TypeScript counterpart where the comparison helps, and every snippet is compiled and run, so the output you see is the output you will get.
Studio and Toolchain to Intents and Resources move into Android Studio 234 , Gradle 19,597 and the parts every Android app shares: the project layout, the manifest, activities and their lifecycle, intents, permissions and resources. Composables to Animation in Compose teach Compose, from composable functions and recomposition to lists, adaptive layouts, Material 3 15,533 theming, images, navigation and animation. The architecture and data layer follow in ViewModel and UDF to Securing Data on the Device: ViewModel and StateFlow, dependency injection with Hilt and Koin, Room 234 , DataStore 234 , Retrofit 43,944 and Ktor 274,728 , WorkManager 234 and on-device security. The rest of the chapter covers device features, testing, debugging, performance, R8 234 , publishing to Google Play 1 , and Kotlin Multiplatform 25,990 .
Throughout, you rebuild BookNest, the small bookshop from the earlier chapters, as a native app: the same six books, the same catalog, book detail, reading notes and cart. Because the data and screens match, you can put the Compose version next to the Cordova, Framework7, React Native and Capacitor builds and judge the differences in code size, startup time and feel for yourself.
What you will learn:
How Kotlin's syntax, type system and null safety map onto what you already know from TypeScript
Functions, lambdas, classes, sealed hierarchies, generics and the collections pipeline
Coroutines and Flow for asynchronous work that is cancelled when a screen goes away
The Android project structure, the Gradle build, the manifest, activities and the lifecycle
Building declarative UIs with Jetpack Compose, state, navigation, Material 3 and animation
Structuring an app with ViewModel, unidirectional data flow and dependency injection
Caching data with Room and DataStore and calling REST APIs with Retrofit or Ktor
Using the camera, location, notifications and background work within Android's limits
Testing, profiling, shrinking and signing an app, and publishing it on Google Play
Sections
- Kotlin for JS Developers
- Null Safety
- Functions and Lambdas
- Classes and Data Classes
- Sealed and Enum Classes
- Companions and Generics
- Collections and Sequences
- Coroutines and Flow
- Studio and Toolchain
- Project Anatomy
- Manifest and Lifecycle
- Intents and Resources
- Composables
- State and Recomposition
- Compose Side Effects
- Layouts and Modifiers
- Lists with LazyColumn
- Adaptive Layouts
- Material 3 and Theming
- Images with Coil and Glide
- Navigation Compose
- Animation in Compose
- ViewModel and UDF
- Hilt and Koin
- Local Storage with Room
- Preferences with DataStore
- Retrofit and Ktor
- WorkManager
- Securing Data on the Device
- Notifications and Widgets
- Camera with CameraX
- Location and Sensors
- Background Execution Limits
- Testing
- Debugging and Profilers
- Performance
- R8
- Publishing to Google Play
- Kotlin Multiplatform
- Test Yourself!