SpellCheckerService

public abstract class SpellCheckerService
extends Service

java.lang.Object
   ↳ android.content.Context
     ↳ android.content.ContextWrapper
       ↳ android.app.Service
         ↳ android.service.textservice.SpellCheckerService


SpellCheckerService provides an abstract base class for a spell checker. This class combines a service to the system with the spell checker service interface that spell checker must implement.

In addition to the normal Service lifecycle methods, this class introduces a new specific callback that subclasses should override createSession() to provide a spell checker session that is corresponding to requested language and so on. The spell checker session returned by this method should extend SpellCheckerService.Session.

Returning spell check results

SpellCheckerService.Session#onGetSuggestions(TextInfo, int) should return spell check results. It receives TextInfo and returns SuggestionsInfo for the input. You may want to override SpellCheckerService.Session#onGetSuggestionsMultiple(TextInfo[], int, boolean) for better performance and quality.

Please note that SpellCheckerService.Session#getLocale() does not return a valid locale before SpellCheckerService.Session#onCreate()

Summary

Nested classes

class SpellCheckerService.Session

This abstract class should be overridden by a concrete implementation of a spell checker. 

Constants

String SERVICE_INTERFACE

Inherited constants

Public constructors

SpellCheckerService()

Public methods

abstract SpellCheckerService.Session createSession()

Factory method to create a spell checker session impl

final IBinder onBind(Intent intent)

Implement to return the implementation of the internal spell checker service interface.

Inherited methods

Constants

SERVICE_INTERFACE

Added in API level 14
public static final String SERVICE_INTERFACE

Constant Value: "android.service.textservice.SpellCheckerService"

Public constructors

SpellCheckerService

public SpellCheckerService ()

Public methods

createSession

Added in API level 14
public abstract SpellCheckerService.Session createSession ()

Factory method to create a spell checker session impl

Returns
SpellCheckerService.Session SpellCheckerSessionImpl which should be overridden by a concrete implementation.

onBind

Added in API level 14
public final IBinder onBind (Intent intent)

Implement to return the implementation of the internal spell checker service interface. Subclasses should not override.

Parameters
intent Intent: The Intent that was used to bind to this service, as given to Context.bindService. Note that any extras that were included with the Intent at that point will not be seen here.

Returns
IBinder Return an IBinder through which clients can call on to the service.