KeyboardView is deprecated in android

Solution 1:

The only solution Google suggests is copying KeyboardView.java and Keyboard.java files to your local project from Android AOSP. With some customization I managed to make it work as old deprecated KeyboardView and Keyboard Android's classes.

You will also have your local copy of com.android.internal.R attributes (stylable) from from here

You can notice, it is annotated as

<!-- {@deprecated Copy this definition into your own application project.} -->

Google:

This class was deprecated in API level 29. This class is deprecated because this is just a convenient UI widget class that application developers can re-implement on top of existing public APIs. If you have already depended on this class, consider copying the implementation from AOSP into your project or re-implementing a similar widget by yourselves