I'am Naol Kebede
I'am Naol Kebede

Reputation: 55

accessing a device's dictionary

I am a beginner in android programming and I was wondering if one can access words from a device's built-in dictionary.i was working on an app that accepts an input(word) and then checks weather the word's spelling is correct or not by comparing it with the device's dictionary. Is it possible to access and manipulate a device's dictionary? If it is, how?

Upvotes: 1

Views: 1162

Answers (2)

Apurva
Apurva

Reputation: 7911

It is called spell checker in android. The Android platform offers a spelling checker framework that lets you implement and access spell checking in your application.

In order to use spelling checker , you need to implement SpellCheckerSessionListener interface and override its methods. Its syntax is given below:

public class HelloSpellCheckerActivity extends Activity implements SpellCheckerSessionListener {
    @Override
    public void onGetSuggestions(final SuggestionsInfo[] arg0) {
       // TODO Auto-generated method stub 
    }

    @Override
    public void onGetSentenceSuggestions(SentenceSuggestionsInfo[] arg0){
       // TODO Auto-generated method stub   
    } 
}

Click on this link for a full example.

Upvotes: 1

Suhail Mehta
Suhail Mehta

Reputation: 5542

You can only access to user dictionary which will include user defined words for input methods to use for predictive text input. Applications and input methods may add words into the dictionary.

http://developer.android.com/reference/android/provider/UserDictionary.html

you can also use this source to search in dictionary data . Provide you have to add dictionary words

http://www.java2s.com/Code/Android/Database/SearchableDictionary.htm

Upvotes: 0

Related Questions