Follow Slashdot blog updates by subscribing to our blog RSS feed


Forgot your password?
Android IOS Programming Software

Android Needs a Simulator, Not an Emulator 167

An anonymous reader writes Jake Wharton, Android Engineer at Square, has written an article about one of the big problems with building apps for Android: developers need a simulator for testing their software, rather than an emulator. He provides an interesting, technical explanation of the difference between them, and why the status quo is not working. Here are the basics of his article: "A simulator is a shim that sits between the Android operating system runtime and the computer's running operating system. It bridges the two into a single unit which behaves closely to how a real device or full emulator would at a fraction of the overhead. The most well known simulator to any Android developer is probably (and ironically) the one that iOS developers use from Apple. The iPhone and iPad simulators allow quick, easy, and lightweight execution of in-development apps. ... There always will be a need for a proper emulator for acceptance testing your application in an environment that behaves exactly like a device. For day-to-day development this is simply not needed. Developer productivity will rise dramatically and the simplicity through which testing can now be done will encourage their use and with any luck improve overall app quality. Android actually already has two simulators which are each powerful in different ways, but nowhere near powerful enough."
This discussion has been archived. No new comments can be posted.

Android Needs a Simulator, Not an Emulator

Comments Filter:
  • by thatkid_2002 ( 1529917 ) on Wednesday June 18, 2014 @05:28AM (#47261035)
    Android is available for x86 these days and you can use hardware acceleration [] (CPU and GPU). Just set it up and get near-native performance. Or if you have an Android phone just `adb install -r blah.apk` what more can you want?
  • Re:simulator? (Score:2, Informative)

    by Anonymous Coward on Wednesday June 18, 2014 @05:45AM (#47261073)

    You clearly need to get your terminology straight.

    What you describe as a "bridge" is more like a house for homeless people.

    But simulator is the correct terminology... the way you might want to implement it doesn't make any difference.

  • by Anonymous Coward on Wednesday June 18, 2014 @06:19AM (#47261175)

    Very much in Android, including application code, is not Java.

  • by Anonymous Coward on Wednesday June 18, 2014 @06:21AM (#47261181)

    Great. Now, do you have a spare tablet around for every target android version?

    This is the general problem with Android in any case, since versions are not kept up to date on all devices, not all devices have the same resolution, CPU capabilities, graphics performance, input devices, cameras, accelerometer, GPS hardware, touch screen capability, keyboards, and so on and so on.

    You will always need to test on the actual hardware to be sure your monster Intel box and nVidia video cards aren't giving you a false idea of how fast your app is, or that your app doesn't suck, or that it'll work with a particular device.

    If you need hit over the head with a clue bat, ask Roxio how they do it for Angry Birds testing.

  • by cerberusss ( 660701 ) on Wednesday June 18, 2014 @06:31AM (#47261203) Homepage Journal

    "Just set it up" isn't as easy as you make it out to be. I just tried it in Android Studio.

    First, you have to install a 3rd party kernel extension (from Intel). Then you have to configure an AVD with the new x86 value for the CPU/ABI field. It didn't appear for some reason for my target "Android 4.4.2". After looking around, I found another download in the Android SDK Manager called "Intel x86 Atom System Image", let's download that. The documentation mentions this, but I glossed over it. OK, back to the AVD manager and create a virtual device.

    Now I finish it, and run the app. Running the app takes 39 seconds, as Grails reports (about 5 seconds, if that, on Xcode for the iOS port of our project). It asks where I want to run it, pick the new AVD and click Run. It starts Android but not the app.

    Weird. OK, so I run it again with the simulator running. The option "choose a running device" cannot be selected. That's strange. I pick the new AVD again and unfortunately, it starts another copy. Shit. I let it boot but notice it's really slow as usual -- ten minutes later it's still booting. I check the already running copy and click around. Slow as hell as well. Apparently it's not accelerated at all!

    At this point, I'm ready to give up and go back to testing on a device again.

    The above is tested on a 2013 MacBook Air with 8 gigs of memory.

  • by Threni ( 635302 ) on Wednesday June 18, 2014 @06:32AM (#47261209)

    Yes. You can step through the code on your device from your pc. (Even if connected over wifi. Which is nice, when it works, but it's a little flakey. It's solid over USB though).

  • by The1stImmortal ( 1990110 ) on Wednesday June 18, 2014 @06:48AM (#47261249)
    How about Genymotion? [] - uses VirtualBox as the underlying x86 VM layer, instead of AVD + HAXM. Supports a few additional sensors too (either emulated or passed through from real hardware if it has them)
  • Re:So much wrong (Score:5, Informative)

    by coinreturn ( 617535 ) on Wednesday June 18, 2014 @07:23AM (#47261385)

    I should note that I do not do game development; I've no experience in writing apps with high performance 2d/3d graphics.

    Well, then, when you try doing those things you'll understand why my comment is true.

    Well, I won't. I have five games in the App Store and I have always used the simulator for development. It works very well. For me, it is VERY rare that something works on one while not working on the other.

  • by sheltond ( 252356 ) on Wednesday June 18, 2014 @08:56AM (#47261715)

    Yes. Genymotion is great.

    Really fast, lots of different system images for different Android versions and device configurations (screen sizes and densities, input devices, etc), integrates nicely with adb and Eclipse (I haven't tried it in Android Studio, but I imagine it works equally well).

Today is a good day for information-gathering. Read someone else's mail file.