VirtualBox - Super-fast emulator - win32

The place to discuss anything and everything about running your LiveCode on Android

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

VirtualBox - Super-fast emulator - win32

Post by BarrySumpter » Sat May 05, 2012 4:40 am

Not sure what I going on now.
I've had this up n running over the last 3 - 4 days with livecode.
Rebooted pc this morning and can't get consistant results anymore.
Emulator does show up in target test devices but won't install anymore with an error.
Gotta put this on hold for now.

-----


This alternative to the Google Emulator is actually faster than testing on my device.

1. Setup Android guest OS on VirtualBox.
2. How to run the Android guest OS on VirtualBox in portriate mode.
3. How to mount an SD card.

getting-started-on-android-for-x86-step-by-step-guide-on-setting-up-android-2223-for-x86-testing-environment-in-oracle-virtualbox
http://software.intel.com/en-us/blogs/2 ... irtualbox/

http://www.basic4ppc.com/forum/basic4an ... droid.html

(Note: At STEP 5 you can go straight for the Live CD option for initial testing)
http://androidspin.com/2011/01/24/howto ... virtualbox
Hi all

I am enjoying B4A even more so now after installing a super-fast Android on my Windows PC. The install is actually a virtual Android (Froyo 2.2 build) and is MUCH faster than the emulator!



INSTALLATION
======================================
First of all, follow this excellent guide for setting up and installing

How to install Android x86 2.2 (with Virtual Box)

At STEP 5 you can go straight for the Live CD option for initial testing


BEFORE LAUNCHING THE VIRTUAL ANDROID
=========================================
set the VirtualBox machine's network mode (under Settings > Network) to Bridged Adapter and accept the defaults. Your PC and emulated PC will now have IP addresses in the same range

Double-Click the virtual Android entry to launch the virtual x86 Android
Once the emulator is running, press Alt + F1
Type netcfg then note the IP address ** (usually starting with 192.168.x.xxx) (mine return 192.168.1.3)
Return to the emulator by pressing Alt + F7

Getting B4A to communicate with Android
======================================
Open the Windows command prompt (Start > Run > CMD)
Navigate to wherever Android\platform-tools folder is
Type adb connect 192.168.x.xxx (the address noted at ** above) (92.168.1.3)

Try compiling a B4A project. If everything is good your app/game should appear (very quickly) in the virtual Android

TIP -- You can create a *.bat file to aid in establishing the connection. This is something you can simply double-click to carry out command line instructions. My own "Android-Connect.bat" file contains the following. Change the directory and IP address as necessary

Code:

Code: Select all

m:
cd android
cd platform-tools
adb connect 192.168.1.3
exit
(Note: you can download and install the windows utility "Command Prompt Here".
Then navigate to the android-sdk-windows folder via windows explorer,
Right click on platform-toosl and select Command prompt Here.
a dos cmd window should open and you type: adb connect 192.168.1.3
Leave this dos cmd window open so you can execute the connect command again when the connecting is lost.)





Happy coding, and enjoy WARP SPEED!


Windows keys and their Android actions
====================================
Right Control (only) = Default HOST key (break out of virtual Android)

Escape key (or right-mouse button) = Android BACK key
HOME or Windows Key = Android HOME key
MENU key or middle mouse button = Android MENU key
END = Android POWER button
Right Control = Default HOST key (break out of virtual Android)
Last edited by BarrySumpter on Mon May 07, 2012 3:15 am, edited 6 times in total.
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

VirtualBox - Super-fast emulator - Portrait

Post by BarrySumpter » Sat May 05, 2012 4:44 am

HOW TO CREATE A PORTRAIT SCREEN
=====================================
This one is quite involving but here is how I managed to get a portrait screen set up (as 480x800):

1) Close any virtual Android that may be running. It must be powered off instead of using the snapshot option
2) Open Windows command prompt (Start > Run > CMD)
3) Navigate to where VirtualBox is installed
4) Type VBoxManage setextradata "NameOfYourAndroidVM" "CustomVideoMode1" "480x800x16"

* The NameOfYourAndroidVM is as shown in the VirtualBox list. For example, I called mine "Android x86 2.2 Froyo" as instructed.

5) Run your VM Android from the VirtualBox
6) Move cursor to Live CD - VESA mode then press TAB
7) Edit the line and change the vga=788 to vga=999
8) You should get an error message. Press ENTER to see a list of display options
9) Enter the code for your 'portrait' screen setting. Mine came up under mode value 360:

The boot sequence should now kick off. If all goes to plan you get a nice portrait layout
TIP: Press MENU key (Windows Menu key) to quickly unlock the screen
Last edited by BarrySumpter on Mon May 07, 2012 1:33 am, edited 1 time in total.
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Re: Super-fast alternative to emulator -> x86 Android

Post by BarrySumpter » Sat May 05, 2012 6:15 am

I am not sure what your setup is like there but, here are some additional details on how to change resolutions at a later stage

1> Whilst inside the Android VM hold END key to invoke the 'Android POWER button'. Select Reboot.
2> When you arrive back at the GNU Grub screen with the list of boot options select one of them (such as Android-x86 2.2 MDPI) then press 'e' to edit the entry
3> Press 'e' again to edit the top line (kernal /android-2.2/kernal ...)
4> Scroll left (with left arrow key) and insert the following as one of the parameter options - vga=999
5> Press RETURN to accept changes then 'b' to boot. You should see an error message. Press RETURN then select your new resolution
7> The Android O/S will boot up. Hopefully things look ok. If not you can always try tweaking the DPI value (found in the same line at step 4)
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

VirtualBox - Super-fast emulator - SDCard

Post by BarrySumpter » Mon May 07, 2012 1:02 am

Code: Select all

I gave it a shot, and the SD card mounted! Here are the steps I used for
VirtualBox:

   1. Create a new virtual machine with a hard disk. (- Should be already done in previous posts.)
   2. Launch the Live ISO in Debug mode (I used android-x86-2.2-generic.iso)
   to get the commend prompt.
   3. "fdisk /dev/sda", then type:
      1. "n" (new partition)
      2. "p" (primary partition)
      3. "1" (1st partition)
      4. "1" (first cylinder)
      5. "xx" (choose the last cylinder, leaving room for a 2nd partition)
      6. "w" (write the partition)
   4. Repeat #3, but call it partition 2, and use the remaining cylinders.
   5. "mdev -s"
   6. "mke2fs -j -L DATA /dev/sda1"
   7. "mke2fs -j -L SDCARD /dev/sda2"
   8. Reboot ("reboot -f")

   9. At the boot menu, choose VESA, then hit TAB and type so that the end
   of the line reads: "DATA=sda1 SDCARD=sda2".
   
10. After booting (and of course disabling mouse integration via the
   machine menu), the SD card is read as unformatted, but you can format it by
   going to Settings > SD card & phone settings > Format SD Card, then Mount SD
   card.

The SD card should now work!

...
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Re: VirtualBox - Super-fast emulator - win32

Post by BarrySumpter » Mon May 07, 2012 1:51 am

Don't forget - for portriat AND SDCARD:

on each future exectution of the VirtuaBox emulator

Double click the Emulator
Select Vesa mode using up down keys
Use the Tab key to edit options
change the vga= to vga999
AND
change the Data= to DATA=sda1 SDCARD=sda2
select the video mode - mine was 360

Emulator Menu | Machine | Disable Mouse Integration
Click into the emulator - wait a few seconds for emulator mouse to appear
Use right mouse button for back
Use centre mouse button for menu
Use right control key only to exit emulator

If you are using multiple screen monitors make sure the emulator window is in the MAIN screen monitor.
Otherwise the mouse pointer jumps around quite a bit in windows.

Also may have to:
adb connect 192.168.1.3

kinda a pain but soooooo much faster.
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Re: VirtualBox - Super-fast emulator - win32

Post by BarrySumpter » Sat May 12, 2012 1:32 am

When Finished with emulator

Take Snapshots etc.

Machine | Close | Save the Machine State

Next time Android x68 2.2 Froya will show Snapshot x.
And will open as restore very quickly.
So no need to tab to set 999 or SDCARD next time.

On next close
Machine | Close | Power off the machine | Restore current snapshot 'snapshot x' - Ticked ON
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

Post Reply

Return to “Android Deployment”