Most visited

Recently visited

Added in API level 14

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

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

Please note that getLocale() does not return a valid locale before 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

From class android.app.Service
From class android.content.Context
From interface android.content.ComponentCallbacks2

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

From class android.app.Service
From class android.content.ContextWrapper
From class android.content.Context
From class java.lang.Object
From interface android.content.ComponentCallbacks2
From interface android.content.ComponentCallbacks

Constants

SERVICE_INTERFACE

Added in API level 14
String SERVICE_INTERFACE

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

Public constructors

SpellCheckerService

Added in API level 14
SpellCheckerService ()

Public methods

createSession

Added in API level 14
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
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.

Hooray!