Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Spelling Checker in Android

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 240
    Comment on it

    Android provides a special feature for checking spelling and it is easy to implement in your App.


    Android provides SpellCheckerSessionListener listener that handles spelling checker.

    For spelling checker, we have to implement SpellCheckerSessionListener listener that have some methods that we need to use.

    In order to use spelling checker, you need to implement SpellCheckerSessionListener interface and override its methods.

    Here is the way to implement

    public class CheckSpellingActivity extends Activity implements SpellCheckerSessionListener { 
    @Override public void onGetSuggestions(finalSuggestionsInfo[] arg0)
    { // TODO Auto-generated method stub } @Override Public void onGetSentenceSuggestions(SentenceSuggestionsInfo[] arg0){ // TODO Auto-generated method stub }}

    Then we need to use SpellcheckerSession class.

    private SpellCheckerSession spellCheckerSession; 
    final TextServicesManager  textServicesManager =(TextServicesManager) 
    getSystemService(Context.TEXT_SERVICES_MANAGER_SERVICE); 
    spellCheckerSession = textServicesManager.newSpellCheckerSession(null,null,this,true); 

    Now we have to call getSuggestions() for suggestion and this takes you to onGetSuggestions() where you can handle it.

    spellCheckerSession.getSuggestions(newTextInfo(nameEditText.getText().toString()),2); 

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: