Introducing Ink API, a brand new Jetpack library for stylus apps

Introducing Ink API, a brand new Jetpack library for stylus apps



Introducing Ink API, a brand new Jetpack library for stylus apps

Posted by Chris Assigbe – Developer Relations Engineer and Tom Buckley – Product Supervisor

With stylus enter, Android apps on telephones, foldables, tablets, and Chromebooks turn into much more highly effective instruments for productiveness and creativity. Whereas there’s already rather a lot to consider when designing for big screens – see our full steerage and inspiration gallery – styluses are particularly impactful, reworking these gadgets right into a digital pocket book or sketchbook. Customers count on stylus experiences to really feel as fluid and pure as writing on paper, which is why Android beforehand added APIs to cut back inking latency to as little as 4ms; nearly imperceptible. Nevertheless, latency is only one facet of an inking expertise – builders at the moment must generate stroke shapes from stylus enter, render these strokes rapidly, and effectively run geometric queries over strokes for instruments like choice and eraser. These capabilities can require important funding in geometry and graphics simply to get began.

At present, we’re excited to share Ink API, an alpha Jetpack library that makes it simple to create, render, and manipulate lovely ink strokes, enabling builders to construct wonderful options on prime of those APIs. Ink API builds upon the Android framework’s basis of low latency and prediction, offering you with a strong and intuitive toolkit for integrating wealthy inking options into your apps.

moving image of a stylus writing with Ink API on a Samsung Tab S8, 4ms showing end-to-end latency

Writing with Ink API on a Samsung Tab S8, 4ms end-to-end latency

What’s Ink API?

Ink API is a complete stylus enter library that empowers you to rapidly create revolutionary and expressive inking experiences. It affords a modular structure somewhat than a one-size-fits-all canvas, so you possibly can tailor Ink API to your app’s stack and wishes. The modules embody key functionalities like:

    • Strokes module: Represents the ink enter and its visible illustration.
    • Geometry module: Helps manipulating and analyzing strokes, facilitating options like erasing, and choosing strokes.
    • Brush module: Offers a declarative method to outline the visible fashion of strokes, together with colour, dimension, and the kind of device to attract with.
    • Rendering module: Effectively shows ink strokes on the display, permitting them to be mixed with Jetpack Compose or Android Views.
    • Reside Authoring module: Handles real-time inking enter to create easy strokes with the bottom latency a tool can present.

Ink API is suitable with gadgets operating Android 5.0 (API stage 21) or later, and affords advantages on all of those gadgets. It may well additionally benefit from latency enhancements in Android 10 (API 29) and improved rendering results and efficiency in Android 14 (API 34).

Why select Ink API?

Ink API gives an out-of-the-box implementation for fundamental inking duties so you possibly can create a novel drawing expertise to your personal app. Ink API affords a number of benefits over a totally customized implementation:

    • Ease of Use: Ink API abstracts away the complexities of graphics and geometry, permitting you to focus in your app’s distinctive inking options.
    • Efficiency: Constructed-in low latency assist and optimized rendering guarantee a easy and responsive inking expertise.
    • Flexibility: The modular design lets you decide and select the parts you want, tailoring the library to your particular necessities.

Ink API has already been adopted throughout many Google apps due to these benefits, together with for markup in Docs and Circle-to-Search; and the underlying know-how additionally powers markup in Images, Drive, Meet, Maintain, and Classroom. For Circle to Search, the Ink API modular design empowered the crew to make the most of solely the parts they wanted. They leveraged the stay authoring and brush capabilities of Ink API to render a ravishing stroke as customers circle (to look). The crew additionally constructed customized geometry instruments tailor-made to their ML fashions. That’s modularity at its best.

moving image of a stylus writing with Ink API on a Samsung Tab S8, 4ms showing end-to-end latency

“Ink API was our first selection for Circle-to-Search (CtS). Using their in depth documentation, integrating the Ink API was a breeze, permitting us to achieve our first working prototype w/in only one week. Ink’s customized brush texture and animation assist allowed us to rapidly iterate on the stroke design.” 

– Jordan Komoda, Software program Engineer, Google

Now we have additionally designed Ink API with our Android app companions’ suggestions in thoughts to verify it matches with their current app architectures and necessities.

With Ink API, constructing a pure and fluid inking expertise on Android is less complicated than ever. Ink API permits you to concentrate on what differentiates your expertise somewhat than on the small print of paths, meshes, and shaders. Whether or not you might be exploring inking for note-taking, picture or doc markup, interactive studying, or one thing fully totally different, we hope you’ll give Ink API a attempt!

Get began with Ink API

Able to dive into the nicely of Ink API? Try the official developer information and discover the API reference to start out constructing your next-generation inking app. We’re desperate to see the revolutionary experiences you create!

Notice: This alpha launch is just the start for Ink API. We’re dedicated to constantly enhancing the library, including new options and functionalities based mostly in your suggestions. Keep tuned for updates and be a part of us in shaping the way forward for inking on Android!

Leave a Reply

Your email address will not be published. Required fields are marked *