Search code examples
javaandroidkeyboardspelling

Is there any way to add Autocorrect to my Android Keyboard?


I am working on an Android Keyboard, and I was trying to see if there was any way to add in Autocorrect into it. Or is Autocorrect provided with the Spelling Checker Framework? I cannot find a clear cut answer anywhere on here or any other place that I have looked.

My code for my keyboard can be found here > https://github.com/MJonesDev/AndroidKeyboardPractice


Solution

  • You can't rely on the Spellchecker framework. It isn't included on all devices- specifically Samsung ones. (Which may be my fault- when I worked at Swype and 4.0 was new, its UI was interacting badly with Swype. I asked them to turn it off by default, they decided to remove it entirely).

    Even when it exists it doesn't really provide autocorrect. At best it can give you possibilities, and its then your job to display them, and handle the text correction when one is chosen.

    There are various spelling correction libraries out there of different qualities. Its possible to find open source ones to include if you aren't looking to do anything special.