简体   繁体   中英

Is it possible to make an android keyboard entirely out of Java without using xml

I would like to create an android keyboard as much as possible only using Java.

I am familiar with the traditional android keyboard app setup - xml files for each keyboard 'page' and hardcoded key sizes etc.

I want a lot of customization in my keyboard with the ability to use JSON as a data source for whole keyboard layouts generated with Java.

Has it been done before or am I dreaming?

Of course it is. Any UI can be made without an xml file- you can always create views with new and manually add them to a parent.

Did you mean doing it without using KeyboardView? Yes, you can do that too. KeyboardView is meant as a convenience for very simple keyboards, no real keyboard app uses it- not even google's keyboard. In the InputMethodService's onCreateInputView, return whatever view you wish to use. Any view can be returned. So you can be as flexible as you want.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM