Alternative Android Emulator

Version 1

    if you have developed RhoMobile applications for Android, you have probably have used the Android Emulator for testing your application. Using an emulator is the next best thing to having a device, especially when you have to quickly test on many different flavors of Android with different screen sizes. One of the biggest complaints I hear from developers is that the emulator is very slow. Super slow to start up and sometimes sluggish in normal use. The other day I was helping a customer troubleshoot a problem, and for whatever reason the application would always crash on the emulator. It was fine on an actual device, but the emulator did not like it. I could not waste time trying to figure out what the issue was with the Android emulator, so I sought after another option. To my delight, I found an alternative that not only worked with the application but actually seemed like a better go to option for my Android emulator needs.

     

    Genymotion

    After signing up on Genymotion, a few clicks later I had an Android 4.4 emulator up and running. The whole process probably took less time then if I actually tried to launch an AVD from Android Virtual Device Manager. There are about 20 different preconfigured devices that you can tweak to your hearts content. Each device image has to be downloaded locally to your computer (that is the longest part of the process).

    Screen Shot 2014-10-20 at 9.14.28 AM.jpg

    Then you simply select the virtual device and hit the play button. In a quick time test, Genymotion took about 18 seconds from click to having Android fully booted and ready to use. On the same machine, Android's Virtual Device took a whopping 70 seconds. This may not seem significant to the average Joe, but if you do this often, those precious second/minutes can quickly add up to hours of wasted time (not to mention the frustration factor).

     

    Really??? Fast and Cool features??

    Once your Genymotion virtual device is started, you simply drag your APK onto the GVD and in a matter of seconds it is installed and ready to go. For RhoMobile applications, you will need to set an option in your build.yml to build for the x86 processor:

     

    android:
      abis: [arm,x86]
    

     

    When building your RhoMobile application, it is not integrated with the Simulator option of RhoStudio or with any of the rake build commands. Simply build for a Android 'device' and then check the bin folder of your project for the APK that was produced. You can then simply drag the APK file onto the Genymotion window to install it.

     

    I did not try all of the features in Genymotion, but out of the box you get the ability to simulate battery levels, gps location information as well as standard features like device rotation and buttons like home screen, menu, back, etc. One cool feature allows you to use your webcam as the 'camera' in Android with support for both a front and rear facing camera. If you don't have a webcam (highly unlikely I presume), Genymotion comes with a 'dummy camera'. All of these features are super easy to use with instant availability from a menu on the right side of your GVD that brings up dialogs for full control. No more trying to remember special commands to send to the AVD in order to control it or looking up latitude and longitude coordinates, it is all just a few clicks away.

     

     

    Screen Shot 2014-10-20 at 9.34.30 AM.jpg

    Screen Shot 2014-10-20 at 9.36.58 AM.jpg

     

    Screen Shot 2014-10-20 at 9.37.19 AM.jpg

     

    There are a host of other features that you get with a paid account including a network emulation so you can see how your app behaves under different types of connectivity conditions. Another premium feature allows you to use a real device as a means for simulating multi-touch very easily. There is even a Java API if you want to take it up a few notches and write automated test scripts. If you haven't heard or tried of Genymotion, it is definately worth a look. Their website claims that there are close to one million developers signed up and that it will save you an hour each day in development time. With those numbers and mention of adding other device features like temperature and light sensors emulation, it is worth exploring.

     

    Screen Shot 2014-10-20 at 9.43.55 AM.jpg

    (Image source: www.genymotion.com)