explaingit

android/sunflower

Analysis updated 2026-06-24

17,786KotlinAudience · developerComplexity · 3/5Setup · moderate

TLDR

Sample Android gardening app from Google showing how to migrate an existing View-based app to Jetpack Compose piece by piece. No longer actively maintained.

Mindmap

mindmap
  root((sunflower))
    Inputs
      Plant Data JSON
      Unsplash API Key
    Outputs
      Plant Gallery Screen
      My Garden Screen
    Use Cases
      Learn Compose Migration
      Study Kotlin Android Patterns
      Reference Material 3 Theming
    Tech Stack
      Kotlin
      Jetpack Compose
      Android
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Study how to migrate an existing XML View-based Android app to Jetpack Compose screen by screen.

USE CASE 2

Reference Material Design 3 theming and navigation patterns in a real sample.

USE CASE 3

Use the codebase as a template for a small Kotlin Android app with Room persistence.

USE CASE 4

Learn how to wire an external image API like Unsplash into a Compose UI.

What is it built with?

KotlinJetpack ComposeAndroidGradle

How does it compare?

android/sunfloweropen-ani/animekogoogle/flexbox-layout
Stars17,78617,71418,337
LanguageKotlinKotlinKotlin
Setup difficultymoderatemoderateeasy
Complexity3/53/52/5
Audiencedevelopergeneraldeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires Android Studio and an Unsplash API key to populate the plant gallery screen.

In plain English

Android Sunflower is a sample gardening app created by the Android team to demonstrate best practices for Android development, with a specific focus on migrating an existing app built with the traditional View-based UI system to Jetpack Compose. Jetpack Compose is a modern approach to building Android user interfaces where you describe what the screen should look like using code rather than XML layout files. The app itself is a plant tracking tool, users can browse plants, view details, and manage a personal garden. The functionality is deliberately simple so the focus remains on the code structure and patterns rather than product complexity. It shows how a real app that was originally written using Android's older XML-based Views (Material Design 2) can be gradually migrated to Compose (Material Design 3) piece by piece, rather than requiring a full rewrite all at once. The project is written in Kotlin, Google's recommended language for Android development. It uses the Unsplash API to load plant photos in the gallery screen, so you need a free API key from Unsplash to see that part of the app, though the rest works without it. The README notes that this repository is no longer actively maintained by the Android team, who have shifted focus to the compose-samples repository as the current reference for Compose best practices. Sunflower remains useful as a study case for the migration journey specifically. It is aimed at Android developers who want to see how to adopt Compose in an existing codebase without starting from scratch.

Copy-paste prompts

Prompt 1
Walk me through how android/sunflower migrates one screen from XML Views to Jetpack Compose.
Prompt 2
Adapt the My Garden screen pattern from sunflower for my own list-detail Compose app.
Prompt 3
Help me replace the Unsplash image loader in sunflower with a different photo API.
Prompt 4
Show me how sunflower structures its Room database and DAOs and apply it to my project.
Prompt 5
Compare sunflower's navigation setup to the newer compose-samples and update mine accordingly.

Frequently asked questions

What is sunflower?

Sample Android gardening app from Google showing how to migrate an existing View-based app to Jetpack Compose piece by piece. No longer actively maintained.

What language is sunflower written in?

Mainly Kotlin. The stack also includes Kotlin, Jetpack Compose, Android.

How hard is sunflower to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is sunflower for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.