简单的应用程序在手机中运行而不是在模拟器

时间:2011-09-19 13:06:29

标签: android emulation

我刚用eclipse安装了所有开发android的东西。 我做了一个简单的申请。 我在我的手机上运行它看起来像工作。 我试着在模拟器中运行它,但它在控制台中显示了这个长文本。 谢谢你的时间

java.lang.NullPointerException
    at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.doSyncApp(AndroidLaunchController.java:871)
    at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.syncApp(AndroidLaunchController.java:844)
    at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.clientChanged(AndroidLaunchController.java:1487)
    at com.android.ddmlib.AndroidDebugBridge.clientChanged(AndroidDebugBridge.java:868)
    at com.android.ddmlib.Device.update(Device.java:398)
    at com.android.ddmlib.Client.update(Client.java:835)
    at com.android.ddmlib.HandleAppName.handleAPNM(HandleAppName.java:90)
    at com.android.ddmlib.HandleAppName.handleChunk(HandleAppName.java:64)
    at com.android.ddmlib.MonitorThread.callHandler(MonitorThread.java:414)
    at com.android.ddmlib.MonitorThread.processClientActivity(MonitorThread.java:322)
    at com.android.ddmlib.MonitorThread.run(MonitorThread.java:263)

[2011-09-19 14:51:39 - ddms]null
java.lang.NullPointerException
    at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.doSyncApp(AndroidLaunchController.java:871)
    at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.syncApp(AndroidLaunchController.java:844)
    at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.clientChanged(AndroidLaunchController.java:1487)
    at com.android.ddmlib.AndroidDebugBridge.clientChanged(AndroidDebugBridge.java:868)
    at com.android.ddmlib.Device.update(Device.java:398)
    at com.android.ddmlib.Client.update(Client.java:835)
    at com.android.ddmlib.HandleAppName.handleAPNM(HandleAppName.java:90)
    at com.android.ddmlib.HandleAppName.handleChunk(HandleAppName.java:64)
    at com.android.ddmlib.MonitorThread.callHandler(MonitorThread.java:414)
    at com.android.ddmlib.MonitorThread.processClientActivity(MonitorThread.java:322)
    at com.android.ddmlib.MonitorThread.run(MonitorThread.java:263)

[2011-09-19 14:56:00 - ddms]null
java.lang.NullPointerException
    at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.doSyncApp(AndroidLaunchController.java:871)
    at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.syncApp(AndroidLaunchController.java:844)
    at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.clientChanged(AndroidLaunchController.java:1487)
    at com.android.ddmlib.AndroidDebugBridge.clientChanged(AndroidDebugBridge.java:868)
    at com.android.ddmlib.Device.update(Device.java:398)
    at com.android.ddmlib.Client.update(Client.java:835)
    at com.android.ddmlib.HandleAppName.handleAPNM(HandleAppName.java:90)
    at com.android.ddmlib.HandleAppName.handleChunk(HandleAppName.java:64)
    at com.android.ddmlib.MonitorThread.callHandler(MonitorThread.java:414)
    at com.android.ddmlib.MonitorThread.processClientActivity(MonitorThread.java:322)
    at com.android.ddmlib.MonitorThread.run(MonitorThread.java:263)








private static final int CAMERA_WIDTH = 480;
private static final int CAMERA_HEIGHT = 800;
private Camera mCamera;

private Font mFont;
private Texture mFontTexture;


private ChangeableText textoOut;

@Override
public Engine onLoadEngine() {
     this.mCamera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);
     return new Engine(new EngineOptions(true, ScreenOrientation.PORTRAIT, new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), this.mCamera));

}

@Override
public void onLoadResources() {

    // FUENTES
    this.mFontTexture = new Texture(512, 512, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
    this.mFont = FontFactory.createFromAsset(this.mFontTexture, this, "font/Droid.ttf", 32, true, Color.BLACK);
    this.mEngine.getTextureManager().loadTextures(this.mFontTexture);
    this.mEngine.getFontManager().loadFonts(this.mFont);




}

@Override
public Scene onLoadScene() {
    this.mEngine.registerUpdateHandler(new FPSLogger());
    final Scene scene = new Scene(1);
    scene.setBackground(new ColorBackground(0.09804f, 0.6274f, 0.8784f));
    textoOut = new ChangeableText(50, 50, mFont,"Hola mundo");
    scene.attachChild(textoOut);


    // TODO Auto-generated method stub
    return scene;
}

@Override
public void onLoadComplete() {


}

}

0 个答案:

没有答案