Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm new in andengine . I create following code

public class MainActivity extends BaseGameActivity {

static final int CAMERA_WIDTH = 800;
static final int CAMERA_HEIGHT = 480;

public Font mFont;
public Camera mCamera;

//A reference to the current scene
public Scene mCurrentScene;
public static BaseActivity instance;

public EngineOptions onCreateEngineOptions() {
    instance = this;
    mCamera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);

    return new EngineOptions(true, ScreenOrientation.LANDSCAPE_SENSOR, new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), mCamera);

public void onCreateResources(OnCreateResourcesCallback arg0)
        throws Exception {

    mFont = FontFactory.create(this.getFontManager(),this.getTextureManager(), 256, 256,Typeface.create(Typeface.DEFAULT, Typeface.BOLD), 32);

public void onCreateScene(OnCreateSceneCallback arg0) throws Exception {

    mEngine.registerUpdateHandler(new FPSLogger());
    mCurrentScene = new Scene();
            mCurrentScene.setBackground(new Background(0.09804f, 0.7274f, 0.8f));
 //             return mCurrentScene;


public void onPopulateScene(Scene arg0, OnPopulateSceneCallback arg1)
        throws Exception {
    // TODO Auto-generated method stub



I got code on sites there is returning scene but in AndEngine GLES2 in method onCreateScene() there is no return scene ... so my First run is BLACK .. any suggestion :)

share|improve this question

The definitive answer is that the OpenGL APIs are not implemented on the emulator. Essentially, the OpenGL interface is just a big method stub that does nothing. That means any app that uses OpenGL for rendering will not display on the emulator.

So, yes, use a phone directly to test your application.

share|improve this answer

I've already dumped by AndEngine just like you. I copied the source code from the website, struggled with F5 button during 2 hours. And at last, I found that AndEngine GLES2 DIDN'T work in EMULATOR, in a youtube video of AndEngine's author :D.

Just plug your real Android phone and it'll work.

share|improve this answer
OpenGL work very badly on Emulator!try to use the emulator less as possible. – VinceFR Jul 27 '12 at 9:15
Thanks buddy , I'll try it. :) and there is no need to return Scene object, right? – Jul 27 '12 at 9:20
I think the android original documentation state that the emulator supports no OpenGLES at all :) – Grimshaw Jul 27 '12 at 12:33

I had the same problem as you, the onCreateScene method was void.

Check this post, he is using a callback function to initialize the scene.

share|improve this answer
If you're going to just link elsewhere, it's usually preferable to also include at least an overview of the technique described in the link to ensure your answer still remains valid if the link dies. – Josh Petrie Oct 22 '12 at 15:28

Currently the emulator supports OpenGL ES 2.0 and you can run AndEngine apps in it. The latest emulator also allows you to use your graphics hardware. In combination with Intel HAXM driver and the latest Intel Atom images for Android 4+ and 2.3+ this makes the emulator much faster on Intel machines.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.