This open-source project tests the new Google Ink API with a drawing example. It offers options to select colors, erase parts of the drawing, or clear the entire canvas. It also includes functionality to convert the stroke to a bitmap and to save and load the stroke using a Room database.
- Smooth Drawing: Built with the Ink API for low-latency, freehand drawing with stylus and pointer input.
- Modern UI: Crafted entirely with Jetpack Compose for a declarative and intuitive user interface.
- Color Selection: Allows users to choose from a variety of colors for their drawings.
- Erase Tool: Provides options to erase parts of the drawing or clear the entire canvas.
- Offline Storage: Saves and loads drawings using Room Database, preserving the user's work across app sessions.
- Bitmap Conversion: Includes functionality to convert the ink stroke into a bitmap, which can be displayed in a dialog.
- Scalable Architecture: Follows the MVVM pattern with a repository, ensuring a clean separation of concerns and maintainable code.
- Optimized Performance: Leverages Coroutines for asynchronous tasks, KSP for faster annotation processing (for Room), and R8 for code shrinking.
This project is built with Kotlin and utilizes a variety of modern Android libraries and tools:
- UI: Jetpack Compose, Ink API
- Architecture: MVVM with Repository Pattern
- Asynchronicity: Kotlin Coroutines, Kotlin KTX
- Data: Room Database (for local storage)
- Dependency Injection: Hilt
- Build & Optimization: KSP (for Room), R8, Gradle Kotlin DSL
I began this project to test the new Google Ink API. While I was working on it, my son saw it and asked if he could draw. I told him to wait, then quickly implemented a simple version with options to select colors and erase the drawing. After generating the APKs (my daughter also saw it), I installed the app on their tablet, and they started drawing right away.
- Target SDK: 36
- Minimum SDK: 29
- Ink API Version: 1.1.0-alpha01
- Kotlin Version: 2.3.20
- Gradle Version: 9.1.1
- Ink API Introduction:
- Ink API Setup & Usage:
- Releases & Announcements:
- Ink API: State Preservation
- Official Sample: Cahier on GitHub
- Issue Tracker
- Cahier: OfflineNotesRepository.kt
- Cahier: Converters.kt
- Ink Storage Package Summary
If you enjoy this project, please give it a star! Check out all the stargazers here: Stargazers on GitHub
This project is actively maintained. Feedback, bug reports, and feature requests are welcome! Please feel free to open an issue or submit a pull request.


