{"id":17966147,"url":"https://github.com/nicosnicolaou16/ink_api_compose","last_synced_at":"2025-12-26T02:19:07.965Z","repository":{"id":259914307,"uuid":"871660554","full_name":"NicosNicolaou16/Ink_Api_Compose","owner":"NicosNicolaou16","description":"This open-source project showcases the Google Ink API with drawing, color selection, erasing, stroke-to-bitmap conversion, and Room database support for saving and loading strokes.","archived":false,"fork":false,"pushed_at":"2025-06-20T19:54:02.000Z","size":9710,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-20T20:49:14.240Z","etag":null,"topics":["android","android-application","androidx","androidx-library","api","bitmap","compose","dependency-injection","draw","drawing","drawing-app","ink-api","jetpack-compose","kotlin","kotlin-android","mvvm","open-source","room-database"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NicosNicolaou16.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-10-12T15:27:51.000Z","updated_at":"2025-06-20T19:53:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"b9523320-0a08-44d9-814a-8444b1326ba6","html_url":"https://github.com/NicosNicolaou16/Ink_Api_Compose","commit_stats":{"total_commits":21,"total_committers":2,"mean_commits":10.5,"dds":0.04761904761904767,"last_synced_commit":"cf4cdbefa14538a9f0b8f1d720aa7297b4129bb3"},"previous_names":["nicosnicolaou16/ink_api_compose"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/NicosNicolaou16/Ink_Api_Compose","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NicosNicolaou16%2FInk_Api_Compose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NicosNicolaou16%2FInk_Api_Compose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NicosNicolaou16%2FInk_Api_Compose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NicosNicolaou16%2FInk_Api_Compose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NicosNicolaou16","download_url":"https://codeload.github.com/NicosNicolaou16/Ink_Api_Compose/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NicosNicolaou16%2FInk_Api_Compose/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263594556,"owners_count":23485871,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-application","androidx","androidx-library","api","bitmap","compose","dependency-injection","draw","drawing","drawing-app","ink-api","jetpack-compose","kotlin","kotlin-android","mvvm","open-source","room-database"],"created_at":"2024-10-29T13:07:59.283Z","updated_at":"2025-12-26T02:19:07.959Z","avatar_url":"https://github.com/NicosNicolaou16.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ink API Compose\n\nThis open-source project tests the new Google Ink API with an example for drawing, offering options\nto select colors, erase part of the drawing or clear the entire drawing. It also includes\nfunctionality to convert the stroke to a\nbitmap and to save and load the stroke using a Room database.\n\n## Examples\n\n\u003cp align=\"left\"\u003e\n  \u003ca title=\"simulator_image\"\u003e\u003cimg src=\"examples/Screenshot_20251226_001307.png\" height=\"500\" width=\"200\"\u003e\u003c/a\u003e\n  \u003ca title=\"simulator_image\"\u003e\u003cimg src=\"examples/Screenshot_20251226_001257.png\" height=\"500\" width=\"200\"\u003e\u003c/a\u003e\n  \u003ca title=\"simulator_image\"\u003e\u003cimg src=\"examples/example_gif3.gif\" height=\"500\" width=\"200\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## A Brief History Behind This Repository :smiley:\n\nI began this project to test the new Google Ink API, and while I was working on it, my son saw it\nand asked if he could draw. I told him to wait, then quickly implemented a simple version with\noptions to select colors and erase the drawing. After generating the APKs (my daughter also saw it),\nI installed the app on their tablet, and they started drawing right away.\n\n## Here’s a list of features to highlight for the app\n\n- Color Selection: Allows users to choose from a variety of colors for drawing.\n- Erase Tool: Provides the option to erase part of the drawing or any part of the drawing.\n- Tablet Compatibility: Works seamlessly on tablets for an enhanced drawing experience.\n- Convert the stroke to a bitmap and display it in a dialog.\n- An example of how to save a stroke to the Room database and load it from the database.\n    - In this example, the implementation always uses a single primary key with id = 1, overriding\n      the\n      stroke each time. This is not the best approach, but it is used here for simplicity and\n      demonstration purposes only. When the app goes into the background or is closed, the stroke is\n      saved. When the app is opened again, the last saved stroke is loaded.\n\n# The Project Contain the following technologies\n\nThe [Ink API](https://developer.android.com/develop/ui/compose/touch-input/stylus-input/about-ink-api?utm_source=android-studio-app\u0026utm_medium=app)\nenables smooth, low-latency freehand drawing in Android apps by simplifying stylus and\npointer input handling and graphics rendering. \u003cbr /\u003e\nThe programming language is the [Kotlin](https://kotlinlang.org/docs/getting-started.html), it is a\nmodern, JVM-based programming language that is concise, safe, and interoperable with Java. \u003cbr /\u003e\n[Kotlin Coroutines](https://kotlinlang.org/docs/coroutines-overview.html) is used for asynchronous\ntasks. \u003cbr /\u003e\n[Kotlin KTX](https://developer.android.com/kotlin/ktx) is a collection of Kotlin extensions that\noffer more concise and expressive code for working with Android APIs and libraries.\nThe UI is build using [Jetpack Compose](https://developer.android.com/develop/ui/compose). \u003cbr /\u003e\n[Room Database](https://developer.android.com/training/data-storage/room) is responsible for saving\nthe retrieved data from the remote server, querying data from the local database, and supporting\noffline functionality.  \u003cbr /\u003e\n[Hilt Dependencies Injection](https://developer.android.com/training/dependency-injection/hilt-android)\nis an Android library that simplifies dependency injection by using annotations to automatically\nmanage and provide dependencies across components, built on top of\nDagger. ([Documentation](https://dagger.dev/hilt/)) \u003cbr /\u003e\n[MVVM](https://developer.android.com/topic/architecture#recommended-app-arch) with repository is an\narchitecture where the Repository manages data sources (e.g., network, database), the ViewModel\nprocesses the data for the UI, and the View displays the UI, ensuring a clear separation of\nconcerns. \u003cbr /\u003e\n[KSP](https://kotlinlang.org/docs/ksp-overview.html) (Kotlin Symbol Processing) is a tool for\nprocessing Kotlin code at compile time, enabling developers to create powerful code generation and\nannotation processing solutions. (ksp only setup for Room\nDatabase) ([Repository](https://github.com/google/ksp)) \u003cbr /\u003e\n[R8](https://developer.android.com/build/shrink-code) enabled, is a code shrinker and obfuscator for\nAndroid that optimizes and reduces the size of APKs by removing unused code and resources, while\nalso obfuscating the remaining code to improve security. \u003cbr /\u003e\n[Gradle Kotlin DSL](https://docs.gradle.org/current/userguide/kotlin_dsl.html) is a domain-specific\nlanguage for configuring Gradle build scripts using Kotlin syntax, offering better IDE support and\ntype safety compared to Groovy. \u003cbr /\u003e\n\n## Versioning\n\nInk Api version: 1.0.0 \u003cbr /\u003e\nTarget SDK version: 36 \u003cbr /\u003e\nMinimum SDK version: 29 \u003cbr /\u003e\nKotlin version: 2.3.0 \u003cbr /\u003e\nGradle version: 8.13.2 \u003cbr /\u003e\n\n## References - Useful Links\n\n- https://android-developers.googleblog.com/2024/10/introducing-ink-api-jetpack-library.html \u003cbr /\u003e\n- https://developer.android.com/develop/ui/compose/touch-input/stylus-input/about-ink-api \u003cbr /\u003e\n- https://developer.android.com/develop/ui/compose/touch-input/stylus-input/ink-api-modules \u003cbr /\u003e\n- https://developer.android.com/develop/ui/compose/touch-input/stylus-input/ink-api-setup \u003cbr /\u003e\n- https://developer.android.com/develop/ui/compose/touch-input/stylus-input/ink-api-draw-stroke \u003cbr /\u003e\n- https://developer.android.com/develop/ui/compose/touch-input/stylus-input/ink-api-geometry-apis \u003cbr /\u003e\n- https://developer.android.com/develop/ui/compose/touch-input/stylus-input/ink-api-state-preservation \u003cbr /\u003e\n- https://developer.android.com/jetpack/androidx/releases/ink \u003cbr /\u003e\n- https://x.com/AndroidDev/status/1843758267404554563 \u003cbr /\u003e\n- https://issuetracker.google.com/issues/383380976 \u003cbr /\u003e\n\n### Important Resources for optimize storage to save the Stroke in Room Database (Examples) \u003cbr /\u003e\n\n- https://developer.android.com/develop/ui/compose/touch-input/stylus-input/ink-api-state-preservation \u003cbr /\u003e\n- https://github.com/android/cahier \u003cbr /\u003e\n- https://issuetracker.google.com/issues/468458741 \u003cbr /\u003e\n- https://github.com/android/cahier/blob/main/app/src/main/java/com/example/cahier/data/OfflineNotesRepository.kt \u003cbr /\u003e\n- https://github.com/android/cahier/blob/main/app/src/main/java/com/example/cahier/ui/Converters.kt \u003cbr /\u003e\n- https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.strokes.StrokeInputBatch).encode(java.io.OutputStream) \u003cbr /\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicosnicolaou16%2Fink_api_compose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnicosnicolaou16%2Fink_api_compose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicosnicolaou16%2Fink_api_compose/lists"}