Include Word Suggestions in Android Keyboard

2019-01-26 00:49发布

问题:

Hi I want to include word suggestions in my custom keyboard.

e.g if I write wi it should suggest me whether you want to write "winner" "winks" "wilson" etc

Please guide me.

Thanks

回答1:

Here is the real answer to this question.

It was hard for me to find:

First you need to:

Add Words to Android's UserDictionary

By having the words in the dictionary, they will show up in suggestions.

If you want to exclusively show your words however, then something like the auto-complete dropdown idea is a better fit (that the other answers linked)



回答2:

You can search for source code for android keyboard that are having this suggestion bars, i.e. download source for android gingerbread 2.3 keyboard source code, as android is opensource you can get the code easily.