What this feature does
Modern Android includes on-device text intelligence that turns plain text into useful actions. One example is Smart Linkify: when a messaging app shows you an address, phone number or other entity, Smart Linkify can recognise that entity and make it clickable so you can open it in Maps, dial the number or take some other action without copying and pasting.
That user-facing convenience is powered by a lightweight machine-learning component running right on the phone. The goal is simple: detect entities in a chunk of text and annotate them with the appropriate action, with minimal delay and without sending your text off to a server.
How it works under the hood
Smart Linkify builds on Android’s existing Linkify concept but uses a small neural model to spot entities more reliably than simple regular expressions. The implementation described for that Android release used a compact feed‑forward neural network — the models were small (around 500kB per language) and the inference code was also tiny (around 250kB). Because the models and runtime are designed to be lean, inference finishes quickly on-device, keeping latency low and preserving user privacy.
The feature is exposed to apps through the platform TextClassifier API (the generateLinks method). When an app passes a piece of text to that API, the on-device model classifies segments of the text and returns annotations that map to actions — open a map, add a calendar event, compose an email and so on.
Training and runtime
Models for text tasks are typically trained in a server environment using systems such as TensorFlow. Once trained, the models are exported into a compact format suitable for mobile inference. The implementation used a custom inference library that relies on mobile-friendly technologies like TensorFlow Lite and FlatBuffers to keep the runtime small and fast.
On-device inference is performed by a C++ library that’s part of the Android Open Source Project. Because the model and inference code run locally, apps get immediate results and users’ text isn’t sent to external servers unless an app chooses to do so separately.
Why this matters
There are three practical benefits to this approach:
- Speed: Small models and a compact inference library mean classification happens quickly, so links and actions appear almost instantly. - Privacy: Processing text on the device avoids transmitting potentially sensitive content to cloud services. - Consistency for apps: The TextClassifier API gives developers a standard way to add rich text actions without each app implementing its own detection logic.
The same general machine-learning idea was used to improve other text interactions, such as Smart Text Selection, where the system suggests a helpful selection and relevant contextual actions. The principle is the same: tiny models, efficient on-device inference, and a simple API that apps can call to make ordinary text more useful.