• 11
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

Make the default android emulator faster

The default android emulator is ridiculously slow and resource hungry, which makes it an impractical solution.

How can I speed up the default emulator?

Android Emulator Slow? I got two solutions for you..

  • Optimize and upgrade your system
  • Find a Junk PC, Install Android x86

Optimize and upgrade your system:

  • Install latest Drivers and Updates for your System and OS
  • Install latest Builds of Java, Eclipse and ADT
  • Cleanup Your system for Junk/Temp Files (Usually in Windows root drive). Use tools like Ccleaner
  • Ensure you atleast have 2GB of RAM, 1GB for the Emulator alone. Change the settings while creating an emulator, Disable hardware that you don't use like GPS, Gyroscope or whatever.
  • Increase the Device RAM Size and Cache Partion Size
  • Give ample ammount of time for the Emulator to be ready

  • tools.android.com/recent/emulatorsnapshots try Emulator Snapshots, it works fine as well.

10-50% Boost of performance.

Find a Junk PC, Install Android x86

If you have or can afford an old PC, something like Pentium 4 1GHz or more give this a shot.

Open Up the CPU Box,

  • Pull out unnecessary hardware like modems and add-in cards
  • Clean it up a little bit.. Remove the Dust and all..
  • Disable unwanted peripherals like Floppy, PCI, AGP,....etc in the BIOS.
  • Setup in BIOS so as to boot from CD

Both SATA or PATA Work Well.

  1. Get the Latest Stable Generic Build from android-x86.googlecode.com Here is the Latest Stable(At the time of posting) ISO of 2.2, http://android-x86.googlecode.com/files/android-x86-2.2-generic.iso

  2. Download this ISO and Burn it to a CD. Be sure to download the Generic iso build. This build works for most of the PCs.

  3. Now boot the PC from this CD and install Android. Optionally You can setup an SD card during the install. I recommend setting it up straightaway.
  4. Boot in to android and Setup the settings within Application
      + Unknown Sources - Selected
      + USB Debugging - Selected
      + Stay awake - Selected
      + Allow mock locations - Selected
  1. Get a USB to USB type A Male Cable, Used to connect two USB ports in different PCs. Something like this,

Amazon.com usb cable

  1. Connect the Cable to the Developer Machine,
  2. Install Necessary Driver, You Should Install Google USB driver Package from SDK update Point to C:\android\google-usb_driver. A new Hardware name Android Phone will be installed.

Now type the following in terminal or command-prompt, adb devices

Now you can see your device connected to the adb. Now when you run/test/debug your application in this device.

You can also do this Virtualbox but I'm not sure about how to connect it to the adb. However look at my blog post abt installing it to virtualbox

My Experiment Setup & Result:

Boot-up-Time 13 Secs (Aug 31, 2011 - 2.3.5 Tested on PC, Boot up time is just under 8 Seconds.. Amazing...)
Time for installing an app into device Almost negligible

PC Specs Used For testing:

Pentium 4 @ 2.90GHz With HT.
915G Chipset
2GB RAM
USB Keyboard & USB Mouse
All Serial, PS2, Parallel ports were disabled.

For Photos and more please take a look at my Blog post at sree.cc ----

http://www.sree.cc/google/installing-android-in-pc-virtualbox


100% Boost of performance.

http://code.google.com/p/android-x86/downloads/list
Android 4.0 had been released. Chk out.

  • 14
Reply Report

It's possible to run Android in a virtual machine - I've done it using the Android x86 port (http://www.android-x86.org/). You can download ISOs that can be loaded up into any decent VM software (I use VMWare on my Mac to do it).

Performance is, as you'd expect, very good. Not technically emulation or simulation, since you're actually running Android, but it's the fastest way to run Android on a PC*.

I'm not entirely convinced it's a suitable environment for development - I've actually used it for running large screen versions of apps on non-standard hardware (1080p touchscreens, etc).

At the very least, I think it's the best solution to your question: you can compile Android code, load it into the virtual machine, and run it at normal speed.

*Short of actually booting into it...

Update: Google are now providing Android emulator images that add GPU and native x86 support, so a lot of this advice is hopefully now moot!.

  • 11
Reply Report
      • 2
    • I've tried that too. It's one step closer to the dream development environment, but stil quite buggy. When it works well, it is OK. Unfortunately, it is hard to make it stable. I've had problems struggling with a few resource leaks, which fire my processor to 99-100% all the time, and increase the memory footrpint a bunch of times.
      • 1
    • Yeah - like I said, I don't really think it's suitable for development. It's one of those unfortunate truths that because of iOS's heritage the OS X simulator is exceedingly fast, and Android's emulator is just piss poor (especially for tablet work). I read that Google are 'working' on improving the emulator, but I really doubt any significant progress can be made.
      • 2
    • I don't know. It should be technically possible to speed it up. In that respect, Microsoft did a much better job with the WP7 emulator. Since they released the SDK way before the actual hardware, it was a killer requirement for them to make the development as easy and as fluid as possible ... and they somehow did it. I've been working on games for WP7, and the performance was very good.
    • With Virtual machines you cannot Connect and test softwares in realtime... You can just install them thats all.. Using ADB and ADBD is different very helpful than analyzing by just behavior... I would suggest this as an answer if you could connect the VM to the Eclipse IDE + ADT.
      • 1
    • Um, no - you're wrong. You can use ADB over TCP/IP, so you just use it that way. Either that or I've been dreaming the past few months when I've been doing exactly that! In fact, you just said as much on your own answer! I'm not sure why you think an Android VM install doesn't have a network interface to debug over!

Android development was initially done on a desktop simulator. It has never been an official part of the release, and the code is usually published to the AOSP site in a somewhat broken state, but it's there. The feature that kept it alive was valgrind, since (until recently) that wasn't usable on ARM.

If you look at these docs and scroll down to "Working with the desktop build", you can see some instructions for using the sim-eng build to run a simple Dalvik program.

Running "simulator" launches the wxWidgets-based front-end. From there you can start the system. Source code for that, and a bit of fanciness that does run-time interception of various system calls, can be found in the source tree.

Update: the simulator was removed entirely from the sources for the Ice Cream Sandwich release, so you need to look through the 2.3 (Gingerbread) sources to see it.

  • 7
Reply Report

Granted - Android emulator is slow. But the upside is that when you develop an app, you instantly see where it is slow/lagging, while on last-gen 1GHz+ devices this might not be apparent.

Also, when I test my apps I run them on 2G network to see the delays and where they need to be optimized. If I'd only run them on 10Mbit+ WiFi then delays would not be noticeable.

When developing you have to plan (and test) for the worst conditions, not ideal ones. So, in a sense, slow emulator is actually helpful ;)

  • 4
Reply Report
    • This may be true in many cases, but for game developers, it is virtually impossible to test your game via the emulator. Since everything software-rendered, a game that may run constantly at 30FPS on a Droid will run <1FPS on the Emulator. This is unacceptable and I think this is the main reason the author of this question is looking for a simulation tool