Android Jetpack: TextClassifier Updates
Articles Blog

Android Jetpack: TextClassifier Updates

August 18, 2019

MEGHAN MEHTA: Android Q has
updated the TextClassifier API with Smart Reply, New
Actions, and selections based on understanding
the meaning of text. Smart Reply supplies
short message replies. Suggested actions
include deep links for tracking numbers, opening
addresses, links, and more. It’s automatically used with
MessagingStyle notifications. You can add these features to
other parts of your app using the TextClassifier API. You can analyze the
list of messages to see if there are any
suggested actions or replies by calling suggest conversation
actions with conversation texts on a background thread. This feature is powered
by an on device machine learning model so that text
never leaves the user’s phone. Now, if users select
Text, they can get definitions and
translations using Smart Selection because of
the New, Define, and Translate actions. Users can retrieve a definition
by highlighting the word and selecting the Define option. Similarly, users can
translate foreign text by selecting the text and
then choosing Translate. If they click on one
of these options, it will trigger ACTION_DEFINE
or ACTION_TRANSLATE. These actions will trigger
apps such as Google Translate or Google search. If your app is a dictionary
app or a translation app and you want it to
show up in the toolbar, you’ll need to make a couple of
changes to your apps manifest. First, add an intent filter for
android.intent.action.TRANSLATE or
android.intent.category.DEFINE. Second, your app will receive
the word to be defined or translated using
getIntent.getStr ingExtra(Intent.EXTRA_TEXT). Third, you will be able to
present your apps definition or translation
through your activity. The Language Detection
API helps you identify what language your
users are using from over 120 supported languages. It also uses an on device model. To use this feature, pass a
request on a background thread to the API including the
foreign text and the response will contain the
corresponding language. Using Conversational
Suggestion and Smart Selection can make your app more
intuitive and helpful. Check out the documentation
in the video description to see how to add
them to your app. Make sure you subscribe
to the Android Developers channel for more informative
and fun Android videos. Happy coding.

Only registered users can comment.

  1. 🙏Please develop an Android Studio IDE which can run on mobile devices also.

    😭Problem : Want to develop Android apps but don't have a pc

    Please I request the Android Studio Developers Team to do so…………🤱

Leave a Reply

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