Is there a way to create an android AVD with a system bar like in honeycomb? When I create any AVD I get "hard" keys to appear as part of the emulator and no system bar like in honeycomb. Anyway to get a system bar to show up?
You can do this by creating a new AVD and setting its screen resolution to wxga720. This will make it a "tablet" device.
For those who are actually interested in what is going on here, by creating a device with wxga720 resolution a hardware property called Hardware Back/Home keys
is created and set to no
. Also, another property called Keyboard lid support
is set to no
. These two together are what actually get rid of the "hard keys".
There is a bug in Android that sets the keyboard lid to 'yes' regardless of whether you type 'yes' or 'no'. You can look under your home directory's ".android" folder, look under "avds" then the AVD you craeted, and go edit the config.ini file to set it to 'no'
Here's what worked for me, on both the WXGA720 skin and custom 1280x800 resolution:
Option A: Edit config.ini
.android/avd/<name-of-avd>.avd/
)config.ini
in your desired text editorhw.lcd.density=160
Option B: Edit in Android SDK Manager (GUI)
Tools
| Manage AVDs...
Edit...
Abstracted LCD density
property160
Edit AVD
to saveAfter editing the density, start the AVD and enjoy the Ice Cream Sandwich tablety goodness. :)
It seems like the logic in the emulator that determines whether to present a phone or tablet interface is based on the calculated physical size of the virtual device's screen, which is dependent on two parameters: screen size and pixel density.
Like others, I had used the built-in WXGA720 skin hoping to work with the tablet interface, and was disappointed to be presented with a phone interface in landscape orientation. I even tried a new device with a custom resolution of 1280x800 and set hw.mainKeys
and hw.keyboard.lid
in the config.ini
to no avail.
The WXGA720 skin's default density of 320 produces a calculated screen size of 4.6" diagonal (4" x 2.25"), which I'm surmising is within the emulator's esoteric threshold for a phone device. Even the custom resolution of 1280x800, defaulting at a density of 240 and thereby sporting a whopping 6.3" diagonal (!), is rendered with a phone interface.
Some well-named default AVD skins in the SDK ("WXGA720-phone" & "WXGA720-tablet", e.g.) would help eliminate the confusion here. Perhaps we should nag Google.
I spent some time looking for this and digged trough Android 4.0 source to figure how it works. This is what I found out:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With