Using the emulator

From JPCT
Revision as of 23:39, 1 February 2013 by Admin (Talk | contribs)

Jump to: navigation, search

Using the emulator

The emulator is slow, buggy and just plain sucks for development. I strongly recommend to use a real device. If you absolutely have to, keep in mind that the emulator runs in "ugly but fast" mode by default. If you don't want this, you can trade image quality for speed by calling

gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_NICEST);

on the gl context. But it still sucks IMHO.

Emulator and OpenGL ES 2.0

Starting with Android 4.0.3, the android emulator supports running OpenGL ES2 applications. You need to edit your Android 4.0.3+ emulator image by going down to the hardware section and adding a new property called "GPU emulation" with its value set to "true". GPU emulation can also be activated when running the emulator from the command line by running the following command:

emulator -avd "YOUR_EMULATOR_IMAGE" -gpu on

Currently the emulator reports that it doesn't support GLES 2 emulation, so if you are using something like this:

ActivityManager am = (ActivityManager)getSystemService(Context.ACTIVITY_SERVICE);
ConfigurationInfo info = am.getDeviceConfigurationInfo();
boolean isGLES2supported = info.reqGlEsVersion < 0x20000;

keep in mind "isGLES2supported" will always be "false" even though the emulation is actually supported.


You can watch a video of this new feature in action by clicking on the following link: [1]