nsmirosh / Interactive-Android-Concepts

This is a collection of various code samples of Jetpack Compose and Kotin coroutines. The app is intended to demonstrate the correct and wrong usage of certain concepts.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DALL·E 2023-12-03 17 40 57 - A digital illustration for a GitHub repository banner, showcasing Kotlin coroutines in Android development  The image features a backdrop of an Androi

Android Concepts Examples

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 complex Android 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.

Contents

  1. Coroutines Examples
    • Coroutine cooperation. Building a cooperative coroutine. Link
    • The difference between async {} and launch{}. 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
  2. Jetpack Compose Examples
    • Modifier precedence importance. A Drag-Drop example of modifier usage. Link
    • Demonstration of the usage of rememberUpdatedState() for updating a scheduled lambda Link
    • How rememberCoroutineScope can be used to cancel the execution of a coroutine Link
  3. Other Android Concepts
    • Multiple processes. How you can have your app run in different processes. Link
  4. Progress animation

Coroutines Examples

Coroutine Cooperation

Learn how isActive and CancellationException can be utilized for efficient coroutine cooperation.

final.trimmed.mov

async{} vs launch{}

Explore the differences between async{} and launch{} and how scopes affect their execution and cancellation.

My.Movie.5.mp4

coroutineScope {} influence

Understand how coroutineScope influences coroutine order of execution.

My.Movie.6.mp4

CancellationException vs ordinary exceptions. Exception propagation.

Learn why CancellationException is special in Kotlin coroutines and how exceptions are propagated from child to parent.

exceptions_video.mov

Jetpack Compose Examples

LaunchedEffect and rememberUpdatedState()

Demonstrates the usage of LaunchedEffect and rememberUpdatedState in Jetpack Compose.

My.Movie.2.mp4

Usage of rememberCoroutineScope()

Discover the use of rememberCoroutineScope() for canceling coroutine execution within Compose.

example.mp4

Drag-drop Modifier

You can drag and drop the two modifiers in order to discover how it will influence the Composable.

newrecording.mov

Other Android Concepts

Multiple processes

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

Progress Animation

Canvas-Based Animation

A creative progress animation developed using Canvas, inspired by UX flame.

circle_loading.mp4

About

This is a collection of various code samples of Jetpack Compose and Kotin coroutines. The app is intended to demonstrate the correct and wrong usage of certain concepts.


Languages

Language:Kotlin 95.0%Language:Jupyter Notebook 5.0%