Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 35f78f30 authored by Scott Main's avatar Scott Main Committed by Android (Google) Code Review
Browse files

Merge "docs: add package summary for spell checker services" into ics-mr0

parents 2720cfae b22723c3
Loading
Loading
Loading
Loading
+38 −0
Original line number Diff line number Diff line
<HTML>
<BODY>
<p>Provides classes that allow you to create spell checkers in a manner similar to the
input method framework (for IMEs).</p>

<p>To create a new spell checker, you must implement a service that extends {@link
android.service.textservice.SpellCheckerService} and extend the {@link
android.service.textservice.SpellCheckerService.Session} class to provide spelling suggestions based
on text provided by the interface's callback methods. In the {@link
android.service.textservice.SpellCheckerService.Session} callback methods, you must return the
spelling suggestions as {@link android.view.textservice.SuggestionsInfo} objects. </p>

<p>Applications with a spell checker service must declare the {@link
android.Manifest.permission#BIND_TEXT_SERVICE} permission as required by the service. The service
must also declare an intent filter with {@code &lt;action
android:name="android.service.textservice.SpellCheckerService" />} as the intent’s action and should
include a {@code &lt;meta-data&gt;} element that declares configuration information for the spell
checker. For example:</p>

<pre>
&lt;service
    android:label="&#064;string/app_name"
    android:name=".SampleSpellCheckerService"
    android:permission="android.permission.BIND_TEXT_SERVICE" >
    &lt;intent-filter >
        &lt;action android:name="android.service.textservice.SpellCheckerService" />
    &lt;/intent-filter>
    &lt;meta-data
        android:name="android.view.textservice.scs"
        android:resource="&#064;xml/spellchecker" />
&lt;/service>
</pre>

<p>For example code, see the <a
href="{@docRoot}resources/samples/SampleSpellCheckerService/index.html">Spell
Checker</a> sample app.</p>
</BODY>
</HTML>