Ink App Builder logo

Ink App Builder

OrganizationPopular
android
ink-app-builder

Adds inking and freehand drawing capabilities to an Android app using Jetpack Ink (androidx.ink) and Compose. Use this skill when implementing stylus or touch drawing surfaces, rendering wet and dry ink strokes, configuring stock brushes (pressure pen, marker, highlighter), implementing geometry-based erasing, linear undo and redo history, or stroke persistence with Room. Delivers working Compose and ViewModel implementations. Don't use for View-based (XML) inking or programmatic custom BrushFamily creation. For custom BrushFamily creation, custom tip shapes, or behavior node graphs, suggest the ink-custom-brush-builder skill.

Overview

Publisherandroid
Repositoryskills
Skill nameink-app-builder
Stars
10K
Forks
654
Bundled files
8
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 8 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by android on GitHub. Read the source before you install it.

Installation

Install the Ink App Builder AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/android/skills/tree/main/jetpack-compose/ink/ink-app-builder
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/android/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/jetpack-compose/ink/ink-app-builder .claude/skills/ink-app-builder
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Ink App Builder in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Ink App Builder on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Ink App Builder is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

The Android Ink API (androidx.ink) is a modular Jetpack library for building high-performance, low-latency freehand drawing experiences on Android. It uses a wet ink and dry ink two-phase model:

  • Wet ink : Real-time, ultra-low-latency rendering while the user is drawing, handled by the InProgressStrokes composable.
  • Dry ink : Finalized, immutable Stroke objects rendered by the app using CanvasStrokeRenderer.

Setup and dependencies

The Ink API requires minSdk = 26 , which corresponds to Android 8.0 (API level 26) and higher. All androidx.ink modules MUST share an identical version in gradle/libs.versions.toml. Ask user permission before modifying project build files.

Version selection (1.0.0 stable versus 1.1.0-alpha03 and higher)

  • Use 1.0.0 (Stable) for production apps that rely on StockBrushes or pre-serialized .brush assets decoded with BrushFamily.decode. In 1.0.0 stable, BrushFamily.encode, BrushFamily.decode, AndroidBrushFamilySerialization, and BrushFamilyDecodeCallback require @OptIn(ExperimentalInkCustomBrushApi::class).
  • Use 1.1.0-alpha03 and higher when the app constructs programmatic custom brushes (BrushFamily, BrushCoat, BrushTip, BrushPaint, BrushBehavior) in Kotlin code. Starting in 1.1.0-alpha02 and higher, BrushFamily serialization requires no @OptIn (and in 1.1.0-alpha05 and higher, ExperimentalInkCustomBrushApi is @RestrictTo(LIBRARY_GROUP), so NEVER annotate 1.1.0-alpha03 and higher code with it).

Version catalog (gradle/libs.versions.toml)

[versions]
ink = "<latest_version>"
inputMotionPrediction = "<latest_version>"

[libraries]
# Core Ink modules
androidx-ink-authoring         = { module = "androidx.ink:ink-authoring",         version.ref = "ink" }
androidx-ink-brush             = { module = "androidx.ink:ink-brush",             version.ref = "ink" }
androidx-ink-geometry          = { module = "androidx.ink:ink-geometry",          version.ref = "ink" }
androidx-ink-nativeloader      = { module = "androidx.ink:ink-nativeloader",      version.ref = "ink" }
androidx-ink-rendering         = { module = "androidx.ink:ink-rendering",         version.ref = "ink" }
androidx-ink-strokes           = { module = "androidx.ink:ink-strokes",           version.ref = "ink" }
androidx-ink-storage           = { module = "androidx.ink:ink-storage",           version.ref = "ink" }

# Compose integration modules
androidx-ink-authoring-android = { module = "androidx.ink:ink-authoring-android", version.ref = "ink" }
androidx-ink-authoring-compose = { module = "androidx.ink:ink-authoring-compose", version.ref = "ink" }
androidx-ink-brush-compose     = { module = "androidx.ink:ink-brush-compose",     version.ref = "ink" }
androidx-ink-geometry-compose  = { module = "androidx.ink:ink-geometry-compose",  version.ref = "ink" }

# Motion prediction (required for low-latency stylus tracking)
androidx-input-motionprediction = { module = "androidx.input:input-motionprediction", version.ref = "inputMotionPrediction" }

# Persistence (kotlinx.serialization + Room with KSP)
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinxSerialization" }
androidx-room-runtime      = { module = "androidx.room:room-runtime",  version.ref = "room" }
androidx-room-ktx          = { module = "androidx.room:room-ktx",      version.ref = "room" }
androidx-room-compiler     = { module = "androidx.room:room-compiler", version.ref = "room" }

[plugins]
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
ksp                  = { id = "com.google.devtools.ksp",                   version.ref = "ksp" }

App module configuration (app/build.gradle.kts)

plugins {
    alias(libs.plugins.android.application)
    alias(libs.plugins.kotlin.compose)
    alias(libs.plugins.kotlin.serialization)
    alias(libs.plugins.ksp) // Mandatory when using Room in Kotlin
}

android {
    defaultConfig {
        minSdk = 26
    }
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_17
        targetCompatibility = JavaVersion.VERSION_17
    }
    buildFeatures {
        compose = true
    }
}

dependencies {
    implementation(libs.androidx.ink.authoring)
    implementation(libs.androidx.ink.brush)
    implementation(libs.androidx.ink.geometry)
    implementation(libs.androidx.ink.nativeloader)
    implementation(libs.androidx.ink.rendering)
    implementation(libs.androidx.ink.strokes)
    implementation(libs.androidx.ink.storage)

    implementation(libs.androidx.ink.authoring.android)
    implementation(libs.androidx.ink.authoring.compose)
    implementation(libs.androidx.ink.brush.compose)
    implementation(libs.androidx.ink.geometry.compose)

    implementation(libs.androidx.input.motionprediction)

    implementation(libs.kotlinx.serialization.json)
    implementation(libs.androidx.room.runtime)
    implementation(libs.androidx.room.ktx)
    ksp(libs.androidx.room.compiler) // NEVER use annotationProcessor in Kotlin
}

Core drawing surface and default brush

Create a standard pressure-sensitive pen Brush with Brush.createWithComposeColor (from ink-brush-compose). The epsilon parameter defines the minimum distance between two input points, in stroke-space units, to be considered visually distinct (0.1f for general drawing, 0.01f for fine precision tools; Brush enforces 0f < epsilon <= size):

kotlin
/**
 * Creates a default pressure-sensitive pen [Brush].
 *
 * The `epsilon` parameter sets the geometric tolerance (minimum point distance
 * in stroke units) controlling how far a stroke can be zoomed before triangle
 * artifacts appear (`0f < epsilon <= size`).
 */
fun createDefaultPenBrush(): Brush {
    return Brush.createWithComposeColor(
        family = StockBrushes.pressurePen(),
        color = Color.Black,
        size = 5f,
        epsilon = 0.1f,
    )
}

Stack two layers inside a Box for the drawing surface: a Compose Canvas that renders finalized dry Stroke objects inside nativeCanvas.withSave using CanvasStrokeRenderer, and an InProgressStrokes composable on top for low-latency wet ink capture. Encapsulate a synchronous pendingStrokes Compose Snapshot State buffer inside DrawingSurface so the dry Canvas invalidates in the exact same UI thread run loop when onStrokesFinished fires, preventing a 1-frame wet-to-dry flicker:

kotlin
@Composable
fun DrawingSurface(
    strokes: List<Stroke>,
    canvasStrokeRenderer: CanvasStrokeRenderer,
    currentBrush: Brush,
    onGetNextBrush: () -> Brush,
    onStrokesFinished: (List<Stroke>) -> Unit,
    isEraserMode: Boolean,
    modifier: Modifier = Modifier,
    textureStore: AppTextureBitmapStore = LocalTextureStore.current,
    onErase: (Float, Float) -> Unit = { _, _ -> },
    onEraseStart: () -> Unit = {},
    onEraseEnd: () -> Unit = {},
) {
    val cacheGen by textureStore.generation.collectAsStateWithLifecycle()

    // Holds newly finished strokes synchronously for the single frame before
    // asynchronous StateFlow collection delivers the updated strokes list.
    var pendingStrokes by remember { mutableStateOf<List<Stroke>>(emptyList()) }

    SideEffect {
        if (pendingStrokes.isNotEmpty()) {
            pendingStrokes = if (strokes.isEmpty()) {
                emptyList()
            } else {
                pendingStrokes.filter { pending -> strokes.none { it === pending } }
            }
        }
    }

    val strokesToDraw = remember(strokes, pendingStrokes) {
        if (pendingStrokes.isEmpty()) {
            strokes
        } else {
            strokes + pendingStrokes.filter { pending -> strokes.none { it === pending } }
        }
    }
    val identityMatrix = remember { Matrix() }

    val currentOnErase by rememberUpdatedState(onErase)
    val currentOnEraseStart by rememberUpdatedState(onEraseStart)
    val currentOnEraseEnd by rememberUpdatedState(onEraseEnd)

    Box(modifier = modifier) {
        // Layer 1: Dry ink - completed strokes + same-frame pending handoff strokes
        Canvas(modifier = Modifier.fillMaxSize()) {
            val nativeCanvas = drawContext.canvas.nativeCanvas
            strokesToDraw.fastForEach { stroke ->
                nativeCanvas.withSave {
                    canvasStrokeRenderer.draw(
                        canvas = this,
                        stroke = stroke,
                        strokeToScreenTransform = identityMatrix,
                    )
                }
            }
        }

        // Layer 2: Eraser touch handler OR Wet ink (InProgressStrokes)
        if (isEraserMode) {
            Box(
                modifier = Modifier
                    .fillMaxSize()
                    .pointerInput(Unit) {
                        detectDragGestures(
                            onDragStart = { currentOnEraseStart() },
                            onDragEnd = { currentOnEraseEnd() },
                            onDragCancel = { currentOnEraseEnd() },
                            onDrag = { change, _ ->
                                currentOnErase(change.position.x, change.position.y)
                                change.consume()
                            },
                        )
                    }
            )
        } else {
            key(cacheGen) {
                InProgressStrokes(
                    defaultBrush = currentBrush,
                    nextBrush = onGetNextBrush,
                    onStrokesFinished = { newStrokes ->
                        pendingStrokes = pendingStrokes + newStrokes
                        onStrokesFinished(newStrokes)
                    },
                    textureBitmapStore = textureStore,
                )
            }
        }
    }
}

Workflow and task routing

Follow these conditional instructions based on the requested task:

  • Step 1 (Dependencies and SDK setup) : When adding Ink API dependencies or configuring minSdk, follow the setup blocks in this file and the Ink API setup guide. Verify that ink-nativeloader, ink-authoring-android, and androidx.input:input-motionprediction are present.
  • Step 2 (Drawing surface and stroke rendering) : When creating a Compose drawing screen with wet ink (InProgressStrokes) and dry ink (CanvasStrokeRenderer), implement DrawingSurface from this file and review Draw a stroke. For InProgressStrokes parameter details, BlendMode.Multiply highlighter layer compositing, and TextureBitmapStore generation invalidation, you MUST follow drawing-and-brushes.md.
  • Step 3 (Stock brushes and brush switching) : When creating, modifying, or switching stock brushes (StockBrushes.pressurePen, marker, highlighter, dashedLine, or emojiHighlighter), review Brush APIs and you MUST follow drawing-and-brushes.md for epsilon geometry constraints, highlighter alpha preservation, and Android 14 (API level 34) emojiHighlighter rules.
  • Step 4 (Eraser, undo and redo, and MVVM architecture) : When implementing a geometry-based stroke eraser, linear undo and redo history stacks, or MVVM ViewModel and Hilt wiring, review Geometry APIs and you MUST follow editing-and-architecture.md.
  • Step 5 (Persistence, bitmap export, and gesture coexistence) : When saving and loading strokes with Room (StrokeInputBatch.encode and decode), preserving UI state across configuration changes, exporting drawings to a Bitmap or PNG file, or combining long-press drag gestures with drawing (pointerInputWithSiblingFallthrough), review State preservation and persistent storage and you MUST follow persistence-and-advanced.md.
  • Programmatic custom brushes : For custom BrushFamily creation, custom tip shapes, or behavior node graphs, suggest the ink-custom-brush-builder skill.

Antipatterns

  • NEVER use InProgressStrokesView in Compose screens ---that's the View-based API. Use the InProgressStrokes composable instead.
  • NEVER omit ink-nativeloader or ink-authoring-android ---missing ink-nativeloader throws UnsatisfiedLinkError, and missing ink-authoring-android throws ClassNotFoundException at runtime.
  • NEVER use View.OnTouchListener or MotionEvent directly ---the InProgressStrokes composable captures and processes touch and stylus input internally.
  • NEVER draw strokes manually with Canvas.drawPath or by iterating stroke points---always call CanvasStrokeRenderer.draw(canvas, stroke, transform).
  • NEVER call CanvasStrokeRenderer.create(forcePathRendering = true) ---the 2-argument forcePathRendering overload is @RestrictTo(LIBRARY_GROUP). Use the public CanvasStrokeRenderer.create(textureStore) factory, which automatically detects software Bitmap canvases and falls back to path rendering.
  • NEVER rely solely on asynchronous StateFlow collection in onStrokesFinished ---InProgressStrokes removes completed wet strokes immediately after onStrokesFinished returns on the UI thread, while collectAsStateWithLifecycle updates on a later run loop, causing a 1-frame wet-to-dry flicker. Always mutate Compose Snapshot State synchronously in the same UI thread run loop using a pendingStrokes buffer as shown in DrawingSurface.
  • NEVER store strokes as bitmaps for undo, redo, or database persistence---store Stroke objects in memory and serialize StrokeInputBatch bytes with brush metadata for disk storage.
  • NEVER use annotationProcessor for Room in Kotlin ---always apply the com.google.devtools.ksp plugin and use ksp(libs.androidx.room.compiler) to avoid AppDatabase_Impl does not exist crashes at launch.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Ink App Builder AI skill do?

Adds inking and freehand drawing capabilities to an Android app using Jetpack Ink (androidx.ink) and Compose. Use this skill when implementing stylus or touch drawing surfaces, rendering wet and dry ink strokes, configuring stock brushes (pressure pen, marker, highlighter), implementing geometry-based erasing, linear undo and redo history, or stroke persistence with Room. Delivers working Compose and ViewModel implementations. Don't use for View-based (XML) inking or programmatic custom BrushFamily creation. For custom BrushFamily creation, custom tip shapes, or behavior node graphs, sugges...

Why use Ink App Builder on TypingMind?

Because you install it once and use it with any model. Ink App Builder is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Ink App Builder in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/android/skills/tree/main/jetpack-compose/ink/ink-app-builder. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Ink App Builder?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Ink App Builder?

As many as you like. As long as a model supports skills, you can use Ink App Builder with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Ink App Builder AI skill free?

Yes. It is published on GitHub by android under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇