Stay organized with collections
Save and categorize content based on your preferences.
android.service.textservice
Provides classes that allow you to create spell checkers in a manner similar to the
input method framework (for IMEs).
To create a new spell checker, you must implement a service that extends SpellCheckerService
and extend the SpellCheckerService.Session
class to provide spelling suggestions based
on text provided by the interface's callback methods. In the SpellCheckerService.Session
callback methods, you must return the
spelling suggestions as SuggestionsInfo
objects.
Applications with a spell checker service must declare the BIND_TEXT_SERVICE
permission as required by the service. The service
must also declare an intent filter with <action
android:name="android.service.textservice.SpellCheckerService" />
as the intent\u2019s action and should
include a <meta-data>
element that declares configuration information for the spell
checker. For example:
<service
android:label="@string/app_name"
android:name=".SampleSpellCheckerService"
android:permission="android.permission.BIND_TEXT_SERVICE" >
<intent-filter >
<action android:name="android.service.textservice.SpellCheckerService" />
</intent-filter>
<meta-data
android:name="android.view.textservice.scs"
android:resource="@xml/spellchecker" />
</service>
For example code, see the sample Spell
Checker service app, and the sample Spell
Checker client app.
Classes
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# android.service.textservice\n\nAdded in [API level 14](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nandroid.service.textservice\n===========================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/service/textservice/package-summary \"View this page in Kotlin\") \\|Java\n\nProvides classes that allow you to create spell checkers in a manner similar to the\ninput method framework (for IMEs).\n\nTo create a new spell checker, you must implement a service that extends [SpellCheckerService](/reference/android/service/textservice/SpellCheckerService) and extend the [SpellCheckerService.Session](/reference/android/service/textservice/SpellCheckerService.Session) class to provide spelling suggestions based\non text provided by the interface's callback methods. In the [SpellCheckerService.Session](/reference/android/service/textservice/SpellCheckerService.Session) callback methods, you must return the\nspelling suggestions as [SuggestionsInfo](/reference/android/view/textservice/SuggestionsInfo) objects.\n\nApplications with a spell checker service must declare the [BIND_TEXT_SERVICE](/reference/android/Manifest.permission#BIND_TEXT_SERVICE) permission as required by the service. The service\nmust also declare an intent filter with `\u003caction\nandroid:name=\"android.service.textservice.SpellCheckerService\" /\u003e` as the intent\\\\u2019s action and should\ninclude a `\u003cmeta-data\u003e` element that declares configuration information for the spell\nchecker. For example: \n\n```\n \u003cservice\n android:label=\"@string/app_name\"\n android:name=\".SampleSpellCheckerService\"\n android:permission=\"android.permission.BIND_TEXT_SERVICE\" \u003e\n \u003cintent-filter \u003e\n \u003caction android:name=\"android.service.textservice.SpellCheckerService\" /\u003e\n \u003c/intent-filter\u003e\n \u003cmeta-data\n android:name=\"android.view.textservice.scs\"\n android:resource=\"@xml/spellchecker\" /\u003e\n \u003c/service\u003e\n \n```\n\nFor example code, see the sample [Spell\nChecker service](/resources/samples/SpellChecker/SampleSpellCheckerService) app, and the sample [Spell\nChecker client](/resources/samples/SpellChecker/HelloSpellChecker) app.\n\nClasses\n-------\n\n|---------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------|\n| [SpellCheckerService](/reference/android/service/textservice/SpellCheckerService) | SpellCheckerService provides an abstract base class for a spell checker. |\n| [SpellCheckerService.Session](/reference/android/service/textservice/SpellCheckerService.Session) | This abstract class should be overridden by a concrete implementation of a spell checker. |\n\n-\n\n Classes\n -------\n\n - [SpellCheckerService](/reference/android/service/textservice/SpellCheckerService)\n - [SpellCheckerService.Session](/reference/android/service/textservice/SpellCheckerService.Session)"]]