Avatar of ptreves186
ptreves186
 asked on

android emulator problems

Hello,

I know that the standard ARM emulator that comes with Android is pretty slow the first time it is started-up. I heard that I could setup inside a VirtualBox an Android image.
I have followed the following instructions:

http://www.andreybutov.com/2011/10/14/how-to-set-up-a-faster-android-emulator/

However, when typing the command:

adb connect 192.168.56.102
unable to connect

Also, I found an Android 4.1 image that loads-up and runs great in the Virtual Box but I am unable to create a hard drive configuration under the Settings - Storage options.
The Android 2.3.3 image freezes at the point where it needs to install the linux kernal.

Suggestions as to what could be the problem ?

Paolo
Editors IDEsSmartphone ProgrammingAndroid

Avatar of undefined
Last Comment
alexey_gusev

8/22/2022 - Mon
alexey_gusev

with GPU support, why would you want to bother with VBox?
ptreves186

ASKER
I am not sure how that works. It looks like a new feature from Google.
Attached are 2 screen shots of an error I encounter when trying to setup android SDK in VirtualBox.

Suggestions ?

Paolo
AndroidICS-VB-Error.JPG
harddrive.JPG
alexey_gusev

re GPU support, see eg http://android-developers.blogspot.co.uk/2012/04/faster-emulator-with-better-hardware.html

it was releases not that while ago, and it is really easy to add: select it just like you select eg SD card support when you build your emulator image. imho, it's MUCH easier than trying to battle with VBox. I didn't try the latest SDK revision (#20) yet, so maybe Google improved it even more.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
ptreves186

ASKER
ptreves186

ASKER
Most of my experience with handroid has been with Android version 2.3.3.
The emulator is very slow to start-up. The snapshot feature helps on repeat start-ups.

My understanding that Android 4.0 introduced GPU support (ICS).
The latest Android revision is 4.1 (JellyBean).

That means that I would need to upgrade all my android projects to android 4.0 at least.
Of maybe create a new AVD (Android Virtual Device) supporting SDK revision for android 4.0.
(??)

Paolo
alexey_gusev

no no, it's not ICS, it's the emulator, so it doesn't depend on the OS version.
if your hardware supports GPU then it works with all versions.
why dont you just try it? create new AVD and select GPU support and see what happens ;)
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ptreves186

ASKER
I think GPU stands for Graphics Processing Unit.

emulator -avd em41fast -gpu on
emulator: ERROR: Snapshots and gpu are mutually exclusive at this point. Please turn one of them off and restart the emulator.


emulator -avd em41fast -gpu on
WARNING: Data partition already in use. Changes will not persist!
WARNING: Cache partition already in use. Changes will not persist!
Failed to create Context 0x3005
emulator: WARNING: Could not initialize OpenglES emulation, using software renderer.
emulator: emulator window was out of view and was recentered

The emulator comes-up but remains black. I don't see the typical android keyword or the color display that I expect with android 2.3 (I know the grahics display is different with android 4.0, 4.1).

(???)
alexey_gusev

are you using Eclipse? I think you're trying too much here :)
via AVD Manager in Eclipse, create new AVD for 2.3.3 with GPU support selected and just start it. you don't need a snapshot actually, it remembers the data etc etc
ptreves186

ASKER
Yes, I am using eclipse. THis is the command line output I get:

emulator -avd em233 -gpu on
Failed to create Context 0x03005
emulator: WARNING: Could not initialize OpenlES emulation, using software renderer.
emulator: emulator window was out of view and was recentered

These are the AVD Properties I have set:
Abstracted LCD density:         240
Max VM application heap size:    96
Device ram size:               1024
GPU emulation:                  yes

This works.
However with android 4.0/4.1. I only get to "android" display.
I don't get to the point of seeing the color display.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
ptreves186

ASKER
I have been making progress.
At this point, I have installed Android 4.0 ICS in the Virtual Box and can reboot in (DEBUG) mode. I have read that I need to bring the ethernet adapter UP to allow me to connect an Android Debug Bridge from Eclipse.

I have tried the following series of Linux Korn Shell commands:

I have used the netcfg command to list all the network interfaces available, all have IP 0.0.0.0 except for one which has the loopback IP 127.0.0.1:

netcfg
netcfg ifb0 dhcp
netcfg ifb0 up

But my IP is still: 0.0.0.0/0

Suggestions ?

Paolo
alexey_gusev

try to assign static IP
simonet

Since you`re running Windows, forget about all that`s been said above. Everything.

Since the last 2 updates of the ADK, Intel and Google teamed up to provide a x86 image for the emulated that benefits from the Intel Virtualization instructions present in most Intel CPU from the Intel Core forward.  So, if you CPU supports CPU Virtualization, you can run an Android image in native x86 code and still using native GPU emulation.

Here`s how:

http://software.intel.com/en-us/articles/installing-the-intel-atom-tm-android-x86-emulator-image-add-on-from-the-android-sdk-manager/

(there are other x86 images for the emulator other than the one listed in Intel`s example. I am at this very moment developing my apps on an ICS 4.03 x86 emulator and it is extremely fast. All the images are available in the Android SDK Manager from within Eclipse).

More info here:

http://developer.android.com/tools/devices/emulator.html

Also, if you google for "android x86 emulator", or Android atom emulator, there will be tons of articles about how to optimize the emulator performance on Windows machines.

My emulator is running as fast as my Galaxy S3.

Another thing: testing your apps on an Atom/x86 emulator image has nothing to do with how compatible it will be with Arm devices. After all, the same Java bytecode that will run on an Atom emulator or device, will run just as well on an Arm emulator or device.

Check this too (Intel Hardware Execution Manager how-to):

http://software.intel.com/en-us/videos/channel/android/android-ics-emulator-for-microsoft-windows-with-intel%C2%AE-hardware-accelerated-execution-manager/1668135484001

and this :

http://software.intel.com/en-us/android/
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
alexey_gusev

wow, great post!
ptreves186

ASKER
Hello,

Thanks for your very informative post. I am learning alot.
I would expect that my laptop an Intel Atom would support HAXM but it looks like it does not. (as per screen shots attached).

I managed to install the Intel Atom x86 image and create a corresponding AVD but am unable to install the HAXM driver from Intel.

Can this still work ?
When running the AVD it stops at the "android" display on a black background.
Pressing the Home, Menu or Back buttons on the emulator does not do anything.

Suggestions ?

Paolo
Intel-Harware-Accelerated-Execut.JPG
Gateway-laptop-system-info.JPG
ptreves186

ASKER
This is as far as I get.
AVD-Intel-Atom-x86.JPG
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
simonet

Check in your computer`s BIOS if the virtualization feature is enabled. If it isn`t, do enable it and then try reinstalling HAXM.

Even if it is not supported by the CPU, running the Atom x86 emulator image without HAXM is already a lot faster than the original ARM image.
ptreves186

ASKER
Thanks for the info.
I have check my laptop BIOS and I do not see any Virtualization option.
This is what I get:

CPU Type   Intel(R) Atom(TM) CPU N270 @1.60GHz
CPU Speed 1.60 GHz

HDD Model Name  ST9160314AS
HDD Serial Number  5VC9JCZ4

System BIOS Version  V1.10
VGA BIOS Version  Intel V1585

Product Name LT20
Manufaturer Name Gateway
SATA Mode:    AHCI

I don't see any option to ENABLE Virtualization.
I did install the Android_x86 image and it works without the HAXM driver.

Paolo
ASKER CERTIFIED SOLUTION
alexey_gusev

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question