r/JetpackComposeDev • u/Realistic-Cup-7954 • Oct 06 '25
Tips & Tricks Jetpack Compose Simple: Core Concepts Explained in Q&A
A quick, easy-to-read breakdown of Jetpack Compose fundamentals - explained in a clear Q&A format.
r/JetpackComposeDev • u/Realistic-Cup-7954 • Oct 06 '25
A quick, easy-to-read breakdown of Jetpack Compose fundamentals - explained in a clear Q&A format.
r/JetpackComposeDev • u/Realistic-Cup-7954 • Sep 25 '25
For apps targeting Android 16 (API level 36) or higher and running on Android 16+ devices, predictive back system animations (back-to-home, cross-task, cross-activity) are enabled by default.
Key changes: - onBackPressed() is no longer called - KeyEvent.KEYCODE_BACK is not dispatched
If your app intercepts the back event and you haven't migrated to predictive back yet, you need to:
Migrate to the supported back navigation APIs
Or temporarily opt out by setting the following in your AndroidManifest.xml:
<application
android:enableOnBackInvokedCallback="false"
... >
</application>(You can also set this per <activity> if needed)
Official docs: Predictive Back Navigation
r/JetpackComposeDev • u/QuantumC-137 • Sep 23 '25
This is the solution I've found in researches from different sources, piece-by-piece, and taking the advise from the Good People here. My justification for posting this is:
Most of examples and help one founds in the internet are presented with Advanced Level concepts that confuses a beginner (as one myself). But if, for example, one desires to solve derivatives with effectiveness (using rules), one must first learn to solve it as limit (learning over optimization)
So here is my simple example, an app that can store user objects in the database and then retrieve them (update/delete not implemented yet). Minimal UI, no encryption, asynchronous or live data, no responsive modern UI/UX. I still don't understand routines, flows and view models, so I didn't use them
build.gradle.kts(Tutorial)
plugins{
//copy-paste this bellow the others and sync the changes
id("com.google.devtools.ksp") version "2.0.21-1.0.27" apply false
}build.gradle.kts(Module)
plugins {
//copy-paste this bellow the others
id("com.google.devtools.ksp")
}
dependencies {
//copy-paste this bellow the others and sync the changes
val roomVersion = "2.8.0"
implementation("androidx.room:room-runtime:${roomVersion}")
ksp("androidx.room:room-compiler:$roomVersion")
}User - has the class that represents the table
package com.example.tutorial.models
import androidx.room.PrimaryKey
import androidx.room.Entity
@Entity
data class User(
u/PrimaryKey(autoGenerate = true)
val id: Int = 0,
val email: String?,
val password: String?,
val is_authenticated: Boolean = false
)UserDao - has CRUD functions for the database
package com.example.tutorial.roomdb
import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Update
import com.example.tutorial.models.User
@Dao
interface UserDao {
@Query("SELECT * FROM user WHERE id = :userId")
fun getUserById(userId: Int): User?
@Query("SELECT * FROM user")
fun getUsers(): List<User>
@Insert(onConflict = OnConflictStrategy.REPLACE)
fun insertUser(user: User)
@Update
fun updateUser(user: User)
@Delete
fun deleteUser(user: User)
}UserDatabase - has the database code
package com.example.tutorial.roomdb
import android.content.Context
import androidx.room.Database
import androidx.room.Room
import androidx.room.RoomDatabase
import com.example.tutorial.models.User
@Database(entities = [User::class], version = 1)
abstract class UserDatabase : RoomDatabase() {
abstract fun userDao(): UserDao
}CreateUser - screen/page to create users
package com.example.tutorial.views
import androidx.compose.runtime.Composable
import androidx.room.Room
import com.example.tutorial.models.User
import com.example.tutorial.roomdb.UserDatabase
import androidx.compose.ui.platform.LocalContext
@Composable
fun CreateUsers(navController: NavHostController) {
//...Declaring some variables, and some form to get user email and password
//Database config(The thread function is to perform CRUD operations on the database in different thread - mandatory)
val context = LocalContext.current
val db = Room.databaseBuilder(context, UserDatabase::class.java,
name = "userdb").allowMainThreadQueries().build()
val userDao = db.userDao()
//Storing user data
val user = User(email = email, password = password2)
userDao.insertUser(user)
}UsersList - screen/page to load users from database
package com.example.tutorial.views
import androidx.compose.runtime.Composable
import androidx.room.Room
import com.example.tutorial.components.BodyBase
import com.example.tutorial.models.User
import com.example.tutorial.roomdb.UserDatabase
@Composable
fun UsersList(navController: NavHostController){
//...Declaring some Variables
//Database config(The thread function is to perform CRUD operations on the database in different thread - mandatory)
val context = LocalContext.current
val db = Room.databaseBuilder(context, UserDatabase::class.java,
name = "userdb").allowMainThreadQueries().build()
val userDao = db.userDao()
//Retrieving users
var usersList by remember { mutableStateOf(listOf<User>()) }
usersList = userDao.getUsers()
usersList.forEach { user ->
Text(
text = "Email: ${user.email}",
fontSize = 18.sp,
fontWeight = FontWeight.Bold,
modifier = Modifier
.fillMaxWidth().padding(12.dp)
)
}
}P.S: this is a simple example, but not free of potential improvements. Also it's not the whole app, because the post is too long as it is. But later in Github
r/JetpackComposeDev • u/Entire-Tutor-2484 • Sep 19 '25
Hi devs,
I just launched an app called AppDadz(https://play.google.com/store/apps/details?id=com.testers.pro) that’s made for developers like us.
It has tons of Android + web project source codes, even games, all downloadable in one click.
You can upload your own apps – others can test them, give suggestions, and report bugs/issues to help improve your project.
If you have valuable stuff like source codes or plugins, you can list them for free. We don’t take any commission – buyers will contact you directly.
The whole idea is to make app development easier and more accessible for everyone.
Contributors get their names added as well.
If you’re an Android app dev, I think you should try it out at least once.
r/JetpackComposeDev • u/Realistic-Cup-7954 • Sep 12 '25
Android 16 introduces progress-centric notifications to help users seamlessly track start-to-end journeys in your app.
Check out this sample Compose app for a hands-on demo:
Live Updates Sample
Perfect for developers looking to improve UX with real-time progress tracking.
Progress-Centric Notifications: Best Practices
Set the right fields for visibility.
Use clear visual cues (e.g., vehicle image & color for rideshares).
Communicate progress with concise, critical text (ETA, driver name, journey status).
Include useful actions (e.g., tip, add dish).
Use segments & points to show states/milestones.
Update frequently to reflect real-time changes (traffic, delivery status, etc.).
r/JetpackComposeDev • u/Realistic-Cup-7954 • Sep 08 '25
Learn how to implement split button for toggling related actions in Jetpack Compose. Split buttons open a menu to provide people with more options related to a single action - making your UI more flexible and user-friendly.
Part of Material 3 (introduced in 1.5.0-alpha03*)*
r/JetpackComposeDev • u/Unlikely-Librarian35 • Aug 29 '25
I am wondering how to implement this bottom sheet with sticky/pinned to the bottom action buttons, like in the picture attached.
P.s. this is a Maps app by Yandex
r/JetpackComposeDev • u/Realistic-Cup-7954 • Jul 28 '25
“A small leak will sink a great ship.” – Benjamin Franklin
LeakCanary is a memory leak detection library for Android.
In your build.gradle (app-level)
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.14'That is it. LeakCanary watches your app while you test.
If something leaks (like a screen or object), it notifies you with a clear report.
LeakCanary is not included in release builds (AAB/APK)
It does not affect production size or performance
You don’t need to remove it manually
https://square.github.io/leakcanary/getting_started/
r/JetpackComposeDev • u/jorgecastilloprz • Dec 29 '25
I've been exploring shaders lately, especailly AGSL Shaders using the new RuntimeShader API and I am mindblown. Wrote this one to add a liquid glass effect to any Composable.
https://composeinternals.com/agsl-shaders-jetpack-compose-liquid-glass

r/JetpackComposeDev • u/Realistic-Cup-7954 • Oct 20 '25
Tired of writing the same code twice?
As Android developers, we’ve all faced this:
🟢 Writing UI and logic twice for Android and iOS
🟢 Fixing the same bugs on both platforms
🟢 Keeping everything in sync between Kotlin and Swift
✅ Write UI once and run it on Android, iOS, Desktop, and Web
✅ Share business logic across platforms
✅ Use platform-specific features only when needed
✅ Keep performance fully native
@Composable
fun Greeting(name: String) {
Text("Hello, $name!")
}The same code runs natively on all platforms, saving time and effort.
Compose code is shared across all targets
CMP generates native UI for each platform
Platform-specific features can be added when necessary
Shared business logic reduces duplication
One UI codebase for all platforms
Shared logic and native performance
Faster development and fewer bugs
Works with existing Kotlin projects
Credit : Gourav Hanumante
r/JetpackComposeDev • u/Realistic-Cup-7954 • Oct 10 '25
Learn how to create mesmerizing, fluid blob animations in Jetpack Compose using Canvas, Path, and Animatable.
From simple circles to glowing, breathing organic shapes - step-by-step with Bézier curves and motion magic.
r/JetpackComposeDev • u/jorgecastilloprz • Sep 04 '25

made near to $200k with a Jetpack Compose book and a course.
I have decided to share these numbers and my journey not to brag, but because I know how motivating it can be to see real examples of what's possible. When I was starting out, I wished someone had been this transparent about their path and actual results. If this helps even one developer take that first step toward building something of their own, or gives someone the confidence to price their expertise fairly, then it's worth sharing. We all benefit when more people in our community succeed.
From sharing online, to writing a book, to launching a course, to making side income from it. Read the full story in https://composeinternals.com/how-i-made-side-income-from-jetpack-compose
r/JetpackComposeDev • u/Realistic-Cup-7954 • Aug 09 '25
Practical performance problem solving in Jetpack Compose
Make your Compose app run fast by analyzing system traces and fixing common lag causes.
Measure, analyze, optimize, and re-measure UI performance
Test in release builds with IR8 and baseline profiles
Use Jetpack Macrobenchmark for automated testing
Use Perfetto to see detailed performance traces
Avoid large images on the main thread; use vectors or smaller images
Move heavy work off the main thread with coroutines
Prevent extra recompositions by reading state later or using stable classes
You can learn optimized the performance of a Compose app. Learn more & Please share what you learn.
r/JetpackComposeDev • u/Realistic-Cup-7954 • Jul 29 '25
The animateBounds modifier, introduced at Google I/O 2025, lets you animate a Composable’s size and position in a LookaheadScope for smooth transitions. Ref: Android Developers Blog
Animates changes to a Composable’s size and position.
Requires LookaheadScope for predictive layout calculations.
Perfect for dynamic UI changes, like resizing a box.
This eg animates a Box that changes width when a button is clicked.
package com.android.uix
import androidx.compose.animation.ExperimentalSharedTransitionApi
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.*
import androidx.compose.material3.Button
import androidx.compose.material3.Text
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.compose.animation.animateBounds
import androidx.compose.ui.layout.LookaheadScope
import androidx.compose.ui.tooling.preview.Preview
import com.android.uix.ui.theme.ComposeUIXTheme
@OptIn(ExperimentalSharedTransitionApi::class)
@Composable
fun AnimatedBoxScreen() {
var isSmall by remember { mutableStateOf(true) }
Column(
modifier = Modifier
.fillMaxSize()
.padding(16.dp),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.SpaceBetween
) {
LookaheadScope {
Box(
modifier = Modifier
.animateBounds(this@LookaheadScope)
.width(if (isSmall) 100.dp else 150.dp)
.height(100.dp)
.background(Color(0xFF6200EE))
.border(2.dp, Color.Black),
contentAlignment = Alignment.Center
) {
Text(
text = if (isSmall) "Small" else "Large",
color = Color.White,
fontSize = 16.sp
)
}
}
Spacer(Modifier.height(16.dp))
Button(onClick = { isSmall = !isSmall }) {
Text("Toggle Size")
}
}
}Setup: Use LookaheadScope and animateBounds to animate size/position.
Animation: spring() creates a smooth, bouncy effect.
Dependencies: Requires Compose BOM 2025.05.01+.implementation(platform("androidx.compose:compose-bom:2025.05.01"))
Experiment with animateBounds for dynamic UI animations!
r/JetpackComposeDev • u/thisiscanerkaseler • Aug 10 '26
🚀 New article is out — 13 Compose Mistakes That Are Still Killing Your App’s Performance in 2026 + Claude SKILL to Find Them
After reviewing many Jetpack Compose codebases, I noticed the same mistakes appearing again and again. Some affect performance, some impact maintainability, and others lead to unexpected UI behavior.
In this article, I cover 13 common Compose mistakes, explain why they happen, and show how to avoid them with practical examples.
As a bonus, I also created a Claude Skill that can analyze your project and help identify these issues automatically using Claude CLI.
📖 Read the article: https://blog.watermelonkode.com/13-compose-mistakes-that-are-still-killing-your-apps-performance-in-2026-claude-skill-to-find-96e91a9697e8
Table of contents:
List<T>
Reading state too high in the composable tree
Unstable lambdas passed into "LazyColumn" items
Forgetting "remember()"
State Update
Forgetting "rememberSaveable"
Not giving "LazyColumn" items a stable "key"
Passing the wrong key (or no key) to "LaunchedEffect"
Forgetting "onDispose", or keying "DisposableEffect" on the wrong lifecycle owner
Reading a changing lambda inside a long-lived effect without "rememberUpdatedState"
Using "rememberCoroutineScope" (or "SideEffect") as a substitute for "LaunchedEffect"
Calling composables or "remember" conditionally in a way that breaks the slot table
Fixing "too many parameters" by shoving a whole data class, or a whole ViewModel, into the signature
🎁 Bonus: Claude SKILL
If you’re working with Jetpack Compose or Compose Multiplatform, I’d love to hear which mistake you encounter most often.
#AndroidDev #JetpackCompose #ComposeMultiplatform #Kotlin #KMP #AndroidDevelopment #MobileDevelopment #SoftwareEngineering
r/JetpackComposeDev • u/Ok_Sky3062 • Jan 30 '26
Hi everyone,
I’ve been working on HydroChroma, a Jetpack Compose library that brings "living" fluid design to Android UI.
Why I built this: Most "glass" or "liquid" effects in Android are static images or heavy video files. I wanted a way to make UI elements that react to touch with physics-based fluid distortion and real-time chromatic aberration, running natively on the GPU.
How it works (Technical):
AGSL Shaders: It uses a custom RuntimeShader to displace pixels based on a noise algorithm (sin/cos interference patterns) that reacts to a "progress" uniform.
Touch Physics: It tracks touch velocity using VelocityTracker. When you drag a card, it calculates a stretch factor (scaleX/Y) to simulate surface tension, making the UI feel "jelly-like."
Chromatic Aberration: The shader loops through input colors and offsets them in opposite directions based on the device's tilt sensors (Accelerometer/Gyroscope), creating a 3D holographic depth effect.
RenderEffect Chains: It chains RenderEffect.createRuntimeShaderEffect with Blur and ColorFilters to achieve the frosted glass look without killing performance.
Code Snippet:
Kotlin
HydroChroma(
backdrop = myBackdrop,
animations = animations(onClick = HydroAction.Fluid),
liquidGlass = liquidGlassConfig(
blurRadius = 30.dp,
refractionAmount = 24.dp
)
) {
// Your Composable Content
}Repository: HydroChroma Jetpack Compose Library
It requires Android Tiramisu (API 33+) due to RuntimeShader requirements. I’d love feedback on the shader performance or the API structure!
Credits:
Kyant0's
* Capsule
r/JetpackComposeDev • u/Easy-Doughnut7755 • Nov 17 '25
r/JetpackComposeDev • u/Adventurous-Action66 • Nov 13 '25
🚀 Meet Kprofiles for Kotlin Multiplatform Compose
Side note - I've used early versions of this plugin for my own project to deal with multiple resource flavors (in my case it was one app that I shared between multiple brands), but finally figured out that it is time to polish it and share with the community.
Shipping multiple brands/themes/configs on KMP gets messy fast - Android flavors don’t help outside Android, and "copy-paste resources" is no fun to deal with.
Kprofiles makes it clean and predictable:
- Builds one merged resource tree from overlays (Shared → Platform → Build Type → Profiles) with clear last-wins precedence.
- Keeps variants cross-platform and repeatable - no ad-hoc Gradle hacks.
Bonus: comes with a profile-aware config overlay system—so you can drop BuildKonfig entirely and keep environment/config values consistent across targets.
Tested with iOS, Android, JVM, WASM. I'd love early adopters to give it a spin (and a star!) 🙌
r/JetpackComposeDev • u/Realistic-Cup-7954 • Nov 09 '25
Android Basics with Compose - Adapt for different screen sizes
In this pathway you'll learn how to adapt your app to different screen sizes and provide a better user experience, as well as how to test your adaptive UI.
r/JetpackComposeDev • u/Realistic-Cup-7954 • Oct 12 '25
Big news for students and recent graduates - the Kotlin Multiplatform Contest 2025 is now open!
Top 3 projects → Free trip to KotlinConf 2026 (travel, stay, swag, and spotlight!)
All participants → Kotlin souvenirs + community recognition
r/JetpackComposeDev • u/Realistic-Cup-7954 • Sep 26 '25
IntelliJ IDEA has keyboard shortcuts for most of its commands related to editing, navigation, refactoring, debugging, and other tasks. Memorizing these hotkeys can help you stay more productive by keeping your hands on the keyboard.
https://www.jetbrains.com/help/idea/mastering-keyboard-shortcuts.html
r/JetpackComposeDev • u/Realistic-Cup-7954 • Sep 04 '25
Learn how to style text in Jetpack Compose with color, size, bold, italic, shadows, gradients, HTML links, multiple inline styles, and marquee effects.
r/JetpackComposeDev • u/One-Competition620 • Sep 01 '25
Hey folks,
I’ve been building a navigation library for Jetpack Compose called Pathfinder, built on top of Navigation 3. It came out of frustrations I had with the current navigation APIs, and I wanted something type-safe, testable, and extensible.
Some of the built-in features include:
Sending/receiving results between screens
Launching standard activities
Managing dialogs with ease
Screen chaining (helpful for deep links)
If navigation has ever felt tedious in your Compose projects, Pathfinder might smooth out some of those rough edges. I’d love your feedback, suggestions, or even just to hear how you currently handle navigation in Compose.
GitHub: ampfarisaho/pathfinder
r/JetpackComposeDev • u/Realistic-Cup-7954 • Aug 19 '25
This repository contains practical examples for using Jetpack Navigation 3 in Android apps.
Included recipes:
Basic API
Basic usage
Saveable back stack
Entry provider DSL
Layouts & animations
Material list-detail
Dialog destination
Custom Scene
Custom animations
Common use cases
Toolbar navigation
Conditional flow (auth/onboarding)
Architecture
Modular navigation (with Hilt)
ViewModels
Pass args with viewModel()
Pass args with hiltViewModel()
r/JetpackComposeDev • u/Entire-Tutor-2484 • Aug 13 '25
I am building a simple application with a sign-up form, API integration, and a payment gateway. The requirement is to support Android, iOS, and Web.
I started with Kotlin Multiplatform, but the payment gateway I need does not support Web, and I could not find any third-party SDK for it.
Is it possible to make this application in Kotlin Multiplatform with these requirements? If not, is there any way to work around this, or should I use another framework like Flutter?