user1230985
user1230985

Reputation: 21

How to adapt Android sample soft keyboard to larger screen?

I'm trying to deploy the Android Sample Soft Keyboard as provided with the SDK (2.3.3 February 2012), entirely unchanged, to a device with larger screen (HTC Sensation with 960x540 pixels and 240 LCD density, 4.2 inch diameter).

I noticed that the input view occupies half the screen with the keyboard aligned to the top leaving enormous room for black margins (see image below).

I have tried really hard to make the keyboard/input view align to the bottom of the screen and get rid of the black margins - to no avail (editing the input.xml/qwerty.xml/*.xml apparently does not help).

I can reproduce the behaviour on a virtual device (emulator) with these settings: 960x540 pixels, 240 LCD density) so I think my real device is not the problem.

Any indication on how this might be achieved is highly appreciated. Thanks a lot!

Issue

Upvotes: 1

Views: 452

Answers (1)

user1230985
user1230985

Reputation: 21

After two days of searching I have found the solution myself: adding the following line to "AndroidManifest.xml" did the trick:

<uses-sdk android:minSdkVersion="3" android:targetSdkVersion="4"/>

As I am a newbie on Android I cannot explain why this works - but it does (both in the emulator and the real device). The black margins have gone and the layout works as specified and desired. Hopefully this is useful for others.

Upvotes: 1

Related Questions