This is a collection of code samples and demonstrations focusing on Android development, specifically Jetpack Compose and Kotlin coroutines.
The goal of this repository is to visually illustrate the usage of hard-to-understand Android and Kotlin concepts. The samples aim to be interactive.
All of the video illustrations have corresponding code representations.
Feel free to play around with these examples to get a better understanding of each of the concepts.
You're welcome to contribute your own code samples.
To contribute your own interactive example:
- Find a concept that is not straightforward and not yet covered.
- Contact me to make sure that your MR will get accepted before you start working on it.
- Make sure that what you want to contribute is an interactive and / or visual representation of a certain Android / Kotlin concept.
- Write a detailed post with an explanation of what's going on in your example.
Consult this screen
for reference and see the constant
EXPLANATION_LINK
. - Open an MR with your changes.
To contribute your refactoring / infrastructure changes:
- Contact me to make sure that your MR will get accepted before you start working on it.
- Once you're finished -open an MR with your changes.
- Coroutines Examples
- Coroutine cooperation. Building a cooperative coroutine. Link
- The difference between
async {}
andlaunch{}
. How it influences coroutine execution and cancellation. Link - How
coroutineScope {}
influences the order of execution in coroutines Link - Why is
CancellationException
special? How exception propagation works. Link
- Jetpack Compose Examples
- Other Android Concepts
- Multiple processes. How you can have your app run in different processes. Link
- Progress animation
Learn how isActive
and CancellationException
can be utilized for efficient coroutine
cooperation.
-
final.trimmed.mov
Explore the differences between async{}
and launch{}
and how scopes affect their execution and
cancellation.
My.Movie.5.mp4
Understand how coroutineScope
influences coroutine order of execution.
My.Movie.6.mp4
Learn why CancellationException
is special in Kotlin coroutines and how exceptions are propagated
from child to parent.
exceptions_video.mov
Demonstrates the usage of LaunchedEffect
and rememberUpdatedState
in Jetpack Compose.
My.Movie.2.mp4
Discover the use of rememberCoroutineScope()
for canceling coroutine execution within Compose.
example.mp4
You can drag and drop the two modifiers in order to discover how it will influence the Composable.
newrecording.mov
Two services are launched in different processes and both of the have a RuntimeException().
One service crashes the app and the one that is in the separate process does not.
a865c3cb-fa81-48a1-9898-4595a19a16f9.mp4
A creative progress animation developed using Canvas
, inspired by UX flame.