|
| 1 | +<HTML> |
| 2 | +<BODY> |
| 3 | +<p>Provides classes that allow you to create spell checkers in a manner similar to the |
| 4 | +input method framework (for IMEs).</p> |
| 5 | + |
| 6 | +<p>To create a new spell checker, you must implement a service that extends {@link |
| 7 | +android.service.textservice.SpellCheckerService} and extend the {@link |
| 8 | +android.service.textservice.SpellCheckerService.Session} class to provide spelling suggestions based |
| 9 | +on text provided by the interface's callback methods. In the {@link |
| 10 | +android.service.textservice.SpellCheckerService.Session} callback methods, you must return the |
| 11 | +spelling suggestions as {@link android.view.textservice.SuggestionsInfo} objects. </p> |
| 12 | + |
| 13 | +<p>Applications with a spell checker service must declare the {@link |
| 14 | +android.Manifest.permission#BIND_TEXT_SERVICE} permission as required by the service. The service |
| 15 | +must also declare an intent filter with {@code <action |
| 16 | +android:name="android.service.textservice.SpellCheckerService" />} as the intent’s action and should |
| 17 | +include a {@code <meta-data>} element that declares configuration information for the spell |
| 18 | +checker. For example:</p> |
| 19 | + |
| 20 | +<pre> |
| 21 | +<service |
| 22 | + android:label="@string/app_name" |
| 23 | + android:name=".SampleSpellCheckerService" |
| 24 | + android:permission="android.permission.BIND_TEXT_SERVICE" > |
| 25 | + <intent-filter > |
| 26 | + <action android:name="android.service.textservice.SpellCheckerService" /> |
| 27 | + </intent-filter> |
| 28 | + <meta-data |
| 29 | + android:name="android.view.textservice.scs" |
| 30 | + android:resource="@xml/spellchecker" /> |
| 31 | +</service> |
| 32 | +</pre> |
| 33 | + |
| 34 | +<p>For example code, see the <a |
| 35 | +href="{@docRoot}resources/samples/SampleSpellCheckerService/index.html">Spell |
| 36 | +Checker</a> sample app.</p> |
| 37 | +</BODY> |
| 38 | +</HTML> |
0 commit comments