3

I have developed a Basic Keyboard.

Here is how it looks :

Now, I want to add the Predictive Text Functionality.

I did some research and found some information about Backend part of it. Which showed how the keyboard can learn from user to user.

But I could not find the Front End Part (XML) of it Anywhere.

If this question seems hoax to you, please let me know.

Detained Developer
  • 1,134
  • 2
  • 13
  • 33

1 Answers1

0

You can go to below solution :How to include suggestions in Android Keyboard

ou can use the static method UserDictionary.Words.addWord(....): Link

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
// On JellyBean & above, you can provide a shortcut and an explicit Locale 
UserDictionary.Words.addWord(this, "MadeUpWord", 10, "Mad", Locale.getDefault());
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) {
 UserDictionary.Words.addWord(this, "MadeUpWord", 10, UserDictionary.Words.LOCALE_TYPE_CURRENT);
}

You will need to add this permission to your manifest:

Added words will appear in

Settings > Language & input > Personal dictionary

.

Chetan Joshi
  • 5,582
  • 4
  • 30
  • 43
  • 1
    Thank you, @Chetan Joshi. Though, my main problem is Front End Part. I read the post which you've given the link of. And I read that. But What I was and What I am confused about is Front End ! That post led me to some links which covered Back End Part which I understood. I couldn't find any example, post, blog, video which covers the front end. Now, I am only concerned about FRONT END ! And I tried come layouts with KeyboardView. Every time I got error that gave me conclusion that I can't use any layout with KeyboardView. So, How do I merge KeyboardView and SuggestionStrip ? – Detained Developer Aug 23 '18 at 15:53