Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8418531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:21:40+00:00 2026-06-10T02:21:40+00:00

first time poster, new to Android programming. Using Eclipse classic, have android SDK loaded

  • 0

first time poster, new to Android programming. Using Eclipse classic, have android SDK loaded and the API. Have created a hello world app, and the text send app that follows (android dev site). Now working on a game using the Jimmaru (http://jimmaru.wordpress.com/2011/09/28/andengine-simple-android-game-tutorial/) tutorial (GLES1), using AndEngine (GLES1 as far as I can tell, didn’t have a superclass of “simpleBaseGameActivity” when I looked for it. I’ve gotten the blank screen to show up fine, but the step to add a player sprite results in a force close on app execution/loading.

Here is my One Class (SimpleGame)

package com.example.game;

import org.anddev.andengine.engine.Engine;
import org.anddev.andengine.engine.camera.Camera;
import org.anddev.andengine.engine.options.EngineOptions;
import org.anddev.andengine.engine.options.EngineOptions.ScreenOrientation;
import org.anddev.andengine.engine.options.resolutionpolicy.RatioResolutionPolicy;
import org.anddev.andengine.entity.scene.Scene;
import org.anddev.andengine.entity.scene.background.ColorBackground;
import org.anddev.andengine.entity.sprite.Sprite;
import org.anddev.andengine.entity.util.FPSLogger;
import org.anddev.andengine.opengl.texture.TextureOptions;
import org.anddev.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas;
import org.anddev.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory;
import org.anddev.andengine.opengl.texture.region.TextureRegion;
import org.anddev.andengine.ui.activity.BaseGameActivity;

import android.view.Display;

public class SimpleGame extends BaseGameActivity {

// initiates view
private Camera mCamera;

// Main Scene
private Scene mMainScene;
private Sprite player;

// Textures
private BitmapTextureAtlas mBitmapTextureAtlas;
private TextureRegion mPlayerTextureRegion;

@Override
public Engine onLoadEngine() {
    final Display display = getWindowManager().getDefaultDisplay();
    int cameraWidth = display.getWidth();
    int cameraHeight = display.getHeight();

    mCamera = new Camera(0, 0, cameraWidth, cameraHeight);

    return new Engine(new EngineOptions(true, ScreenOrientation.LANDSCAPE,
            new RatioResolutionPolicy(cameraWidth, cameraHeight), mCamera));
}

@Override
public void onLoadResources() {

    // This places player character on screen, file is in
    // assets/gfx/Player.png
    mBitmapTextureAtlas = new BitmapTextureAtlas(512, 512,
            TextureOptions.BILINEAR_PREMULTIPLYALPHA);

    BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/");

    mPlayerTextureRegion = BitmapTextureAtlasTextureRegionFactory
            .createFromAsset(this.mBitmapTextureAtlas, this, "Player.png",
                    0, 0);

    mEngine.getTextureManager().loadTexture(mBitmapTextureAtlas);

}

@Override
public Scene onLoadScene() {
    mEngine.registerUpdateHandler(new FPSLogger());

    mMainScene = new Scene();
    mMainScene
            .setBackground(new ColorBackground(0.09804f, 0.6274f, 0.8784f));

    mMainScene.attachChild(player);

    final int PlayerX = this.mPlayerTextureRegion.getWidth() / 2;
    final int PlayerY = (int) ((mCamera.getHeight() - mPlayerTextureRegion
            .getHeight()) / 2);

    player = new Sprite(PlayerX, PlayerY, mPlayerTextureRegion);

    return mMainScene;
}

@Override
public void onLoadComplete() {
    // TODO Auto-generated method stub

}

}

Here is my AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.game"
android:versionCode="1"
android:versionName="1.0">

<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="15" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.CAMERA" />

<application android:label="@string/app_name"
    android:icon="@drawable/ic_launcher"
    android:theme="@style/AppTheme">
    <activity android:name="SimpleGame">
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>
    </activity>

</application>

Here is my LogCat File

08-21 14:14:50.116: D/dalvikvm(12704): GC_EXTERNAL_ALLOC freed 76K, 50% free 2737K/5379K, external 0K/0K, paused 33ms

08-21 14:14:50.156: D/AndEngine(12704): UpdateThread interrupted. Don't worry - this Exception is most likely expected!

08-21 14:14:50.156: D/AndEngine(12704): java.lang.InterruptedException

08-21 14:14:50.156: D/AndEngine(12704):     at java.lang.Object.wait(Native Method)

08-21 14:14:50.156: D/AndEngine(12704):     at java.lang.Object.wait(Object.java:358)

08-21 14:14:50.156: D/AndEngine(12704):     at org.anddev.andengine.engine.Engine$State.waitUntilCanUpdate(Engine.java:722)

08-21 14:14:50.156: D/AndEngine(12704):     at org.anddev.andengine.engine.Engine.yieldDraw(Engine.java:472)

08-21 14:14:50.156: D/AndEngine(12704):     at org.anddev.andengine.engine.Engine.onTickUpdate(Engine.java:463)

08-21 14:14:50.156: D/AndEngine(12704):     at org.anddev.andengine.engine.Engine$UpdateThread.run(Engine.java:685)

08-21 14:14:50.316: D/AndroidRuntime(12704): Shutting down VM

08-21 14:14:50.316: W/dalvikvm(12704): threadid=1: thread exiting with uncaught exception (group=0x401cc568)

08-21 14:14:50.316: E/AndroidRuntime(12704): FATAL EXCEPTION: main

08-21 14:14:50.316: E/AndroidRuntime(12704): java.lang.NullPointerException

08-21 14:14:50.316: E/AndroidRuntime(12704):    at org.anddev.andengine.entity.Entity.attachChild(Entity.java:482)

08-21 14:14:50.316: E/AndroidRuntime(12704):    at com.example.game.SimpleGame.onLoadScene(SimpleGame.java:71)

08-21 14:14:50.316: E/AndroidRuntime(12704):    at org.anddev.andengine.ui.activity.BaseGameActivity.doResume(BaseGameActivity.java:169)

08-21 14:14:50.316: E/AndroidRuntime(12704):    at org.anddev.andengine.ui.activity.BaseGameActivity.onWindowFocusChanged(BaseGameActivity.java:85)

08-21 14:14:50.316: E/AndroidRuntime(12704):    at com.android.internal.policy.impl.PhoneWindow$DecorView.onWindowFocusChanged(PhoneWindow.java:2106)

08-21 14:14:50.316: E/AndroidRuntime(12704):    at android.view.View.dispatchWindowFocusChanged(View.java:3925)

08-21 14:14:50.316: E/AndroidRuntime(12704):    at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:665)

08-21 14:14:50.316: E/AndroidRuntime(12704):    at android.view.ViewRoot.handleMessage(ViewRoot.java:1982)

08-21 14:14:50.316: E/AndroidRuntime(12704):    at android.os.Handler.dispatchMessage(Handler.java:99)

08-21 14:14:50.316: E/AndroidRuntime(12704):    at android.os.Looper.loop(Looper.java:130)

08-21 14:14:50.316: E/AndroidRuntime(12704):    at android.app.ActivityThread.main(ActivityThread.java:3703)

08-21 14:14:50.316: E/AndroidRuntime(12704):    at java.lang.reflect.Method.invokeNative(Native Method)

08-21 14:14:50.316: E/AndroidRuntime(12704):    at java.lang.reflect.Method.invoke(Method.java:507)

08-21 14:14:50.316: E/AndroidRuntime(12704):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)

08-21 14:14:50.316: E/AndroidRuntime(12704):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)

08-21 14:14:50.316: E/AndroidRuntime(12704):    at dalvik.system.NativeStart.main(Native Method)

08-21 14:14:54.190: I/Process(12704): Sending signal. PID: 12704 SIG: 9

Any help is much appreciated, thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T02:21:42+00:00Added an answer on June 10, 2026 at 2:21 am

    move this line

    mMainScene.attachChild(player);

    to a point in between these two lines

    player = new Sprite(PlayerX, PlayerY, mPlayerTextureRegion);
    
    return mMainScene;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First time poster. Im totally new to Android but I have manged to dreate
( First-time poster and rather new in programming, so be patient, please! ) I'm
First time poster and fairly new to ASP programming. I am trying to add
Long time reader, first time poster. Any help is greatly appreciated. I have crafted
First time Stack Overflow poster. Please bear with me! :) I have a set
first time poster - semi-newb to Rails. Here is my question. Suppose you have
Hey, first time poster on this awesome community. I have a regular expression in
First time poster, long time lurker :) I have a form setup that posts
Long time lurker, first time poster. I have found some good answers on here
First time poster so please bear with me. Basically I have a pdf document

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.