Open-source project
android/compose-samples avatar
android/compose-samples

android/compose-samples: the official Jetpack Compose sample projects, and how to pick one

Official Jetpack Compose samples.

23,487 stars5,492 forksKotlinApache-2.0

At a glance

What is it?
The repository holds six standalone Android Studio projects plus pointers to two external ones. It is a learning resource, not a library, so the useful question is which sample matches the API you are trying to learn.
Who is it for?
Adopt this repository if you are learning Compose and want runnable code for a specific API, or if you need a reference for adaptive layouts and custom theming before writing your own. Do not adopt it as a dependency, a starter template you intend to ship, or a source of production architecture decisions: the samples differ in complexity on purpose, and the README describes Jetcaster as an advanced sample rather than a recommended baseline.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository received new commits within the last day.
What is it written in?
Mainly Kotlin, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 29, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What android/compose-samples actually gives you

This is a collection of separate Android Studio projects, not a library you add to a build. The README states that the repository contains a set of individual Android Studio projects to help you learn about Compose in Android, and that each sample demonstrates different use cases, complexity levels and APIs. That sentence is the whole design intent. There is no artifact to depend on, no version to bump, and no API surface to keep stable.

The audience is Android developers who already know the platform and want to see Compose applied. If you have never written an Activity or a Gradle build, the samples will not teach you Android; they assume it. The repository's six top-level projects (JetLagged, JetNews, Jetcaster, Jetchat, Jetsnack, Reply) are joined by two additional samples the README points to elsewhere: Now in Android, which lives in its own repository and implements the recommended Android architecture guidelines, and Material Catalog, which lives in AOSP and uses the same samples as the API reference docs.

That split matters when you search. Several of the most-linked Compose examples are not in this repository at all.

How the samples are organised, and why complexity is the sorting key

The README sorts the projects by complexity and by the APIs they exercise. Jetchat is labelled low complexity and focuses on UI state patterns and text input, with a Material Design 3 theme, dynamic color, back button handling, and integration with Navigation, Fragments, LiveData and ViewModel. JetNews and Jetsnack sit at medium complexity: JetNews is a blog post viewer with light and dark themes, resource loading and UI testing; Jetsnack is a snack ordering app with a custom design system, custom layouts and animation. Reply, also medium, targets adaptive design for phones, tablets and foldables with Material 3 theming. Jetcaster is the advanced one, described as having a Redux-style architecture, dynamic theming derived from podcast artwork, image fetching, WindowInsets support, coroutines and local storage with Room. JetLagged is narrower: custom layouts and graphs drawn with Paths.

That is a real gradient, and it is the most useful thing in the README. If you want to learn state hoisting in isolation, Jetchat is the smaller surface. If you want to see a unidirectional data flow with a store, Jetcaster is where the README points, and it is also the sample where you will spend the most time reading before you can change anything.

The README also indexes features across projects rather than describing them per project. Custom layouts are linked in JetNews (the interests screen), Jetchat (animated FAB content), and Jetsnack (a grid and a collapsing image layout). Theming is linked in Jetchat for Material 3, in Jetcaster for a theme built from cover art, and in Jetsnack for a custom design system. Those links are file-level paths into the repository, which is helpful and also fragile: they are the first thing to break when a sample is refactored.

Requirements and how to open a sample in Android Studio

The README lists one requirement: Android Studio. It says you can clone the repository or import the project from Android Studio following the steps in the official setup documentation, and it links to developer.android.com/jetpack/compose/setup#sample. There is no CLI, no package manager install, and no server to run.

In practice you clone and then open one sample directory, not the repository root, because each sample is its own Gradle project:

bash
git clone https://github.com/android/compose-samples.git
cd compose-samples/Jetchat

From there, open the Jetchat folder in Android Studio and let Gradle sync. The README does not document a Gradle command for building from the terminal, so the supported path is the IDE. If you prefer the command line, the repository does not state one, and you should treat any wrapper invocation as something you are figuring out yourself rather than something the project documents.

What you should see after sync is a runnable app module per sample, with the Compose UI in Kotlin source files under the sample's own package (for example com.example.compose.jetchat). The README's feature index links directly to files such as Jetchat/app/src/main/java/com/example/compose/jetchat/components/AnimatingFabContent.kt, which is a reasonable place to start reading if you want the animation code rather than the whole app.

Where the samples stop being a good model

The clearest limitation is stated by the README itself: each sample demonstrates different use cases, complexity levels and APIs. That is a feature for learning and a problem for copying. If you lift the architecture from Jetchat and the architecture from Jetcaster into one app, you are merging two different sets of decisions made for two different teaching goals. Jetchat is deliberately low complexity and integrates Fragments, LiveData and ViewModel; Jetcaster is deliberately advanced and uses a Redux-style store. They are not two halves of one recommended stack.

The second limitation is that a sample repository is not maintained like a library. The samples exist to demonstrate APIs, and the README does not document a compatibility policy, a deprecation policy, or a migration path between releases. The release tags (v2026.08.00, v2026.03.00, v2026.02.00) suggest periodic snapshots, but the README does not explain what a version tag covers or whether every sample is updated together.

The third is scope. Two of the most substantial examples the README recommends, Now in Android and Material Catalog, are not in this repository. Now in Android has its own repository and a Play Store listing; Material Catalog lives in AOSP and the README notes it is always up to date there. If your goal is a full production-shaped app, the README sends you out of this repository to get it.

Alternatives and how they differ

The nearest alternative is Now in Android, which the README lists under additional samples. The difference is not quality, it is purpose: Now in Android is a single app that implements the recommended Android architecture guidelines and integrates Jetpack libraries in the context of a real world app, while compose-samples gives you several smaller apps each aimed at a different API. If you want one coherent architecture to study end to end, Now in Android is the better fit. If you want to isolate how a collapsing image layout or a dynamic theme works, the smaller samples here are easier to read.

The second alternative is Material Catalog, also listed by the README, which is a catalogue of Material Design components in Compose with a theme picker for changing Material Theming values at runtime. It answers "what does this component look like and how do I instantiate it", which the app-shaped samples answer only incidentally.

The third is the official documentation and codelabs at developer.android.com/jetpack/compose, which the README links at the top. Documentation explains concepts; these samples show complete files. Neither replaces the other, and the README treats the docs as the entry point rather than a competitor.

Licence and the cost of following along

The repository is Apache-2.0. That is a permissive licence, and it is the same licence family Android itself uses, so reusing snippets in your own app is the expected use. This is not legal advice; read LICENSE in the repository root if the terms matter to your organisation. Note that the samples include image and font resources under readme/ and within each project, and the repository does not spell out per-asset licensing in the README.

The maintenance cost is the more practical concern. Because each sample is its own Gradle project, upgrading means opening each one you care about and syncing it against your Android Studio and Compose versions, not bumping a single dependency. The repository includes a renovate.json at the top level, which indicates dependency updates are automated on the maintainer side, but that says nothing about whether a sample you forked two years ago still compiles. The last push to the default branch was on 2026-09-18, and the most recent release tag is v2026.08.00 from 2026-08-14, so the repository is being updated; that does not make it a supported dependency.

Editorial conclusion

Adopt this repository if you are learning Compose and want runnable code for a specific API, or if you need a reference for adaptive layouts and custom theming before writing your own. Do not adopt it as a dependency, a starter template you intend to ship, or a source of production architecture decisions: the samples differ in complexity on purpose, and the README describes Jetcaster as an advanced sample rather than a recommended baseline. Before you spend time on any single project, open its folder and check its Gradle and Compose versions against your own toolchain, because the repository keeps several samples at different levels rather than pinning them all to one. Verify first that the sample you picked still matches the API you plan to use, since the README's high level features section links to individual files by path and those paths move.

Frequently asked questions

What is Compose used for?

Jetpack Compose is the Android UI toolkit these samples are built with. The README links to developer.android.com/jetpack/compose for the full description, and the samples cover its use for app UI such as chat, blog reading, podcast playback and adaptive layouts.

How do I use Compose in Android with these samples?

The README requires Android Studio. You can clone the repository or import a project from Android Studio following the steps in the setup documentation it links to, then open one sample folder such as Jetchat and let Gradle sync.

Where can I find Android app samples?

The android/compose-samples repository holds six top-level Android Studio projects (JetLagged, JetNews, Jetcaster, Jetchat, Jetsnack and Reply). The README also points to two additional samples hosted elsewhere: Now in Android and Material Catalog.

Official sources

  1. android/compose-samples on GitHub
  2. License: Apache-2.0
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/android-compose-samples.svg)](https://hysenlabs.com/projects/android-compose-samples)