Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

KeyboardView is deprecated in android

Tags:

android

KeyboardView has been deprecated official by android team in API level 29 and i didn't able to find the alternative way for this. Please let me know if there any alternative?

like image 512
Suraj Bahadur Avatar asked Feb 20 '20 09:02

Suraj Bahadur


1 Answers

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

like image 133
Misha Akopov Avatar answered Oct 23 '22 06:10

Misha Akopov