<< Securing Your Android App | Home

Using the Android-x86 Port as your Emulator

a faster alternative to the Android SDK emulator

Ok here's some basic steps to get it up and running. You'll also be able to save snapshots of running VMs (actually this has always been available with Virtual Box).  Note if you haven't visited http://android-x86.org in awhile some of the docs are already dated - e.g. use generic vs eepc build in Virtual Box:

 
1) Download latest VirtualBox if you haven't http://www.virtualbox.org/wiki/Downloadsand then download
    android-x86-2.2-generic.iso from http://www.android-x86.org/download
 
2) Create and configure your new android vm in VirtualBox Manager. From storage options mount the iso as the cd/dvd and under network use bridged adapter and now you can go ahead and start the VM and choose Live CD Vesa option at boot (don't blink you may miss the Android boot screen).
    
3) Disable mouse integration (right click on mouse configuration button lower right) - you can also make this stick in VBox preferences.
 
4) Use alt-F1 and alt-F7 to toggle to terminal and note the ip address (use netcfg command)
 
5) from host: adb connect [ipaddress]  - you should now be able to see it listed as a device in Eclipse
 
 
Now to add additional screen sizes (and portrait view) such as 320x480,  shutdown and add the following to your .vbox file in the section called ExtraData section: (you can add several)
<ExtraDataItem name="CustomVideoMode2" value="320x480x16"/>
 
And this time when you boot hit tab after selecting VESA mode option to enter additional kernel config boot options - add UVESA_MODE=320x480 and change vga= to vga=ask You'll be prompted to hit enter to view screen size options and your additional options will be available to select (enter number of option to select).
 
vesa options  
 
 
 
 screen shot
 
 
Now you'll notice I also added DATA=sda1 and SDCARD=sda2 (DATA is for persisting apps and settings)
 
But first you'll need to create and setup the two partitions. From the install to harddisk option above in boot menu you can create the 2 paritions. Leave room for both (I gave around 256M to SD card partition).  Now get back to the command line and run:
 
mdev -s
mke2fs -j -L DATA /dev/sda1
mke2fs -j -L SDCARD /dev/sda2  
reboot -f
 
More detailed info re: partitioning is available at: http://www.android-x86.org/documents/virtualboxhowto
 
 
Now from within Android -> Settings you can format and mount the SD card, as well as disable lock screen and increase display timeout.
 
 
If you have any trouble with setting up VirtuallBox, here's my settings (I'm on a Mac OS Host - see VirtualBox manual for other hosts)
 
VB Settings
 
Obviously there's more to making this more automated and a bit more permanent (like editing grub menu etc) - I just wanted to give you the minimal to get it up and running. 
 
One thing I noticed when I enabled my webcam (with USB device filters) is that it successfully detected it which is also the case with 3D hardware graphics acceleration (but not 2D).  In fact although I didn't get an actual camera preview working when I ran a camera application, it was able to actually turn on the device !   Also noteworthy is the low battery notification in the emulator when your laptop battery is indeed low.
 
So it looks like we may not be too far from seeing hardware work in our emulators soon, just some work needed with both projects and this is where you come in as it's all open source.  It seems like opengl on the Android-x86 side is turned off or needs matching configuration (judging by the logs) and on the VBox side, more support is needed for Mac OS X (darwin) so you may get further on Linux and Windows 7 hosts but there still needs some work to be done to make it work better with Android. For example, mouse support could use the equivalent of VBox guest additions for Android-x86 as you'll notice with smaller screen sizes.
 
Some shortcuts from the SDK emulator will be missing of course. For example, you can't toggle betwwen landscape and portrait modes so you'll just have to restart or run a second instance.
 
For info on virtual box and features such as RDP support (which works if you enable it) and additional features like "teleporting" see:
 
 
 
And for an interesting white paper illustrating some ideas using Virtual Box and Android-x86:
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 

 

 

 

 

 

 




Add a comment Send a TrackBack