Ant4res
Ant4res

Reputation: 1225

Custom resolution for android emulator on virtual box

I've developed an Android application but when I try to run it in the emulator via Eclipse, the emulator always takes a LONG time to load. I've decided to create an Android virtual machine on VirtualBox, I've installed AndroBOX-2.3.r.1-generic, it works fine and faster, but when I try to run my app, I have a RuntimeException: unable to start activity ComponentInfo: android.view.InflateException: Binary XML file line #2: Error inflating class GridLayout.

I hope that the problem could be solved if I run the Android virtual machine with a custom resolution. I have developed my app for a 10.1' WXGA800 tablet (Theme.Holo). How can I find the useful resolution data to edit the .vbox configuration file?

<ExtraData>
   <ExtraDataItem name="GUI/LastCloseAction" value="?"/>
   <ExtraDataItem name="GUI/LastGuestSizeHint" value="?,?"/>
   <ExtraDataItem name="GUI/LastNormalWindowPosition" value="?,?,?,?"/>
   <ExtraDataItem name="CustomVideoMode1" value="?x?x?"/> 
</ExtraData>

Thanks a lot.

Upvotes: 2

Views: 9137

Answers (1)

Rotemmiz
Rotemmiz

Reputation: 7971

Regarding your resolution changing question:

You need to configure your desired resolution in two places:

In the VirtualBox virtual machine configuration

  1. Shutdown the VM and VirtualBox.
  2. Use VBoxManage to configure a custom resolution: VBoxManage setextradata "YourVMName" "CustomVideoMode1" "480x800x16" (or any other resolution).

In the VM Grub Configuration

  1. Remonut the boot partition: mount -o remount,rw /mnt
  2. Then, you can edit the menu.lst file: vi /mnt/grub/menu.lst
  3. Default parameters are: quiet root=/dev/ram0 androidboot_hardware=eeepc acpi_sleep=s3_bios,s3_mode DPI=240 SRC=/android-2.3-RC1

  4. add UVESA_MODE=480x800 to the parameter line, like so: quiet root=/dev/ram0 androidboot_hardware=generic_x86 acpi_sleep=s3_bios,s3_mode DPI=240UVESA_MODE=480x800SRC=/android-2.3-RC1

Reboot your machine, it should now boot with the custom resolution you defined.

Upvotes: 8

Related Questions