How to configure the Android Emulator to show onscreen buttons like the new Galaxy Nexus?

こ雲淡風輕ζ 提交于 2019-12-02 17:56:10

It seems the issue was fixed with the latest update of the SDK (R16). Just update your SDK and ADT to R16 and create a new emulator using the updated Android 4.0 system image.

When you create new emulator there is grid Hardware, and there you can add options Hardware home and back buttons and Hardware keyboard. So, create new emulator and look at your "Galaxy Nexus" :)

Unfortunately you can't change this properties for existing emulator.

After upgrading to R16 I could only get the on-screen buttons to appear if I created an emulator using the WXGA720 resolution.

Here is my complete config.ini file:

hw.sdCard=yes
hw.mainKeys=no
hw.lcd.density=320
disk.cachePartition.size=256MB
hw.cpu.arch=arm
skin.name=WXGA720
sdcard.size=512M
abi.type=armeabi-v7a
image.sysdir.2=system-images\android-16\armeabi-v7a\
image.sysdir.1=add-ons\addon-google_apis-google-16\images\armeabi-v7a\
hw.gps=yes
skin.path=platforms\android-16\skins\WXGA720
hw.keyboard.lid=no
hw.cpu.model=cortex-a8
vm.heapSize=48
hw.ramSize=1024

Hopefully this helps someone.

Sam

The soft keys showed up for me when I set hw.mainKeys to no:

  1. Open $HOME/.android/avd/YOURS.avd/config.ini
  2. Set hw.mainKeys=no

(This was covered in a deleted answer; don't know why it was deleted.)

If your application includes functionality that would respond to a menu button, the menu button will be added to the black bottom bar.

If you are having trouble seeing this in the emulator, you can do a bit of a workaround by setting it to a tablet resolution (I use 1280x800) and observing your menu button behavior there, as it should be the same as on the phone version.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!