Google has recently unveiled the second developer preview of Android 16, introducing an array of enhancements aimed at providing developers with greater control and flexibility. Among these new features is the Writing Tools API, a noteworthy addition that allows applications to opt out of AI-driven text generation.
Understanding the Writing Tools API
As developers explore the documentation for Android 16 DP2, they will encounter two significant methods within the EditorInfo
class: isWritingToolsEnabled()
and setWritingToolsEnabled()
. This class serves as a bridge, enabling apps to convey essential information about editable text fields to the current input method, such as an Android keyboard.
The isWritingToolsEnabled()
method indicates whether AI writing tools are active for a given text field, which is set to be enabled by default across all text inputs. The documentation clarifies that developers can disable these tools in contexts where they may not be appropriate, such as password or numeric input fields.
Conversely, the setWritingToolsEnabled()
method empowers apps to prevent AI writing tools from rewriting user-generated text. This feature is particularly relevant as more keyboard applications, like Gboard, integrate AI capabilities to assist users with proofreading and rewriting text through generative AI models.
For instance, Gboard offers a proofreading option on select Pixel devices, enhancing the user experience by correcting spelling, grammar, and punctuation in real-time. However, the introduction of the Writing Tools API raises important considerations for app developers regarding when and how to utilize these AI features.
While the majority of applications may find AI writing tools beneficial, there are specific scenarios where their use could be counterproductive. Fields requiring sensitive information, such as email addresses, passwords, or phone numbers, are prime examples where developers might prefer to disable AI assistance. Although Gboard typically conceals irrelevant options in these contexts, other keyboard apps may not follow suit, highlighting the need for this new API.
Ultimately, the responsibility lies with keyboard app developers to adhere to the guidelines set forth by the Writing Tools API. However, it remains to be seen how effectively they will implement these changes, as users could potentially circumvent restrictions by generating text in alternative applications before pasting it into restricted fields.
As the exploration of Android 16 Developer Preview 2 continues, further insights and updates are anticipated, promising to enrich the developer experience and enhance user interactions across the platform.