Jetpack Ink API: Six Modules for Low-Latency Drawing

▶ Watch (3:21)

Chris demonstrated the six Jetpack Ink API modules through the Cay sample app. The strokes module handles input batching and geometry. The authoring module captures pointer input with near-zero latency using the motion prediction API. The rendering module draws strokes to the Android canvas. The geometry module provides primitives for erasers. Cay creates a mutable parallelogram around the eraser gesture to check intersections with stroke bounding boxes. The storage module uses protobufs and delta compression. Cay encodes stroke data into byte arrays stored as JSON strings in Room.

Custom Brushes with the Visual Brush Designer

▶ Watch (11:46)

Chris released the Brush Designer, a visual tool for building brush behavior graphs. A brush is a dynamic physics model with brush coats. Each coat has a tip (nib geometry) and a paint (color, blending, textures). Behaviors form a node-based logic graph evaluated frame by frame. Stylus pressure or speed passes through math nodes like damping and pipes into targets like size or opacity. The tool exports brushes as .brush files (gzip-compressed protobufs). Cay loads them into the res/raw directory and wires the designer into the Room database for real-time palette updates.

Desktop Windowing and Multi-Instance

▶ Watch (17:12)

Joyce explained how note-taking apps use desktop windowing and multi-instance. Desktop windowing lets users run multiple freely resizable app windows. Cay sets resizableActivity to true in the manifest. Multi-instance allows multiple independent app instances in separate windows. Users can compare two notes side by side. Android 15 introduced supportsMultiInstanceSystemUI. Developers launch new instances with FLAG_ACTIVITY_NEW_TASK and FLAG_ACTIVITY_MULTIPLE_TASK. Notability is officially coming to Android. Notability entered beta on the Play Store with a full launch planned later this year.

Notes Role and Drag-and-Drop Integration

▶ Watch (22:43)

Android’s drag and drop framework uses two Compose modifiers. dragAndDropSource sets a drag source with clipData. Adding DRAG_FLAG_GLOBAL enables cross-app dragging. dragAndDropTarget accepts shouldStartDragAndDrop to inspect MIME types and a DragAndDropTarget interface for callbacks. The notes role identifies a default note-taking app with lock screen shortcuts and floating windows. Lenovo enabled notes role support on Yoga Tab devices running Android 15. Apps declare the CREATE_NOTE intent and check role status with RoleManager. Cay opens a new blank note from the lock screen without unlocking the device.

Notable Quotes

Handle the complex graphics and input processing so you can focus on building unique features. Chris Assigbe · ▶ Watch (2:44)

Notability is officially coming to Android. Joyce Toh · ▶ Watch (18:05)

We’ve open sourced the entire Kai sample and brush designer so you can see exactly how it all fits together. Chris Assigbe · ▶ Watch (28:28)

Key Takeaways

  • Jetpack Ink API’s six modules handle input, rendering, geometry, brushes, and storage for low-latency inking.
  • The visual Brush Designer tool lets teams build custom brush behavior graphs exported as .brush files.
  • Desktop windowing, multi-instance, drag and drop, and the notes role integrate note-taking apps with the Android OS.