Tool Measure keyboard

As IME doesn't fire the height changed event for apps that run full screen, I thought about running a non full screen activity from within my app and getting the values from there. They are close but may need adjustment for the notification area size if you want it 100% accurate, or remove it from the FindKeybHeight activity before running.

This is where my recent post for the blank screen came from as the activity uses IME and opens the window for Text keyboard and numeric keyboard and returns the value.

You can of course update if for any other variant of keyboard you required.

It's fully documented and requires the SLBlankScreen Library which is in the zip file and is a compiled version or the BlankScreen class.

You only really need to run this once for each installation, you can then store the values and check they are not zero before running again.

You can compile this to a library if you wish. The blank screen library required an additional permission.

Edit the manifest and add:
B4X:
AddPermission("android.permission.SYSTEM_ALERT_WINDOW")

I hope you find this useful.
 

Attachments

  • MeasureKeyboard.zip
    12.3 KB · Views: 419
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…