tOnegod on Android?

Hi there, I just made a simple application and I’m attempting to making an android application.

I created a simple game and compiled to an apk and put it on my android device.

When the app starts I get the statistics in the corner (fps objects etc)

but the screen is blank. Running this as a jar file or in the sdk works just fine.

Which leads me to believe that I may have used the GUI the wrong way.

Here is a link to the entire project, and more specifically the GUIManager portion of the application.

Any advice would be helpful!

Thanks for reading

Hey there!

I had a machine failure a bit back and need to reinstall the android jars to test this. Nothing has changed on my end for the library running on android, but I’ll need to get my test app running to see what the differences are.

I should know by tomorrow what the issue is.

Ok… just a quick note to let you know that I am not having an issue running my test app with the latest build of tonegodGUI.

I’ll start comparing the 2 apps and see what the difference is.

Oooo… not only is it running, but the changes to the core shader has made for some drastic improvement. Was hoping this would have a positive effect on Android, but didn’t know until now.

@t0neg0d

I didn’t make any special preparations for it to be android, I only used your default windows and button controllers.

Is there special android elements I should have used?

@BigBob said: @t0neg0d

I didn’t make any special preparations for it to be android, I only used your default windows and button controllers.

Is there special android elements I should have used?

Nope… should just be the default for everything. Though, there may be a setting that needs to be enabled, that’s why I need to take a look at the two projects and verify. In the mean time, try:

Disabling mouse emulation… or whatever the JME option is for that and…
screen.setUseMultiTouch(true);

Here is the default screen setup I use for Android:

[java]
screen = new Screen(this, “tonegod/gui/style/atlasdef/style_map.gui.xml”);
screen.setUseTextureAtlas(true,“tonegod/gui/style/atlasdef/atlas.png”);
screen.setUseMultiTouch(true);
guiNode.addControl(screen);
screen.setUseKeyboardIcons(true);
[/java]

Oh… also, I know I’ve tested this on different deployment targets, but for this round, I was using Android 2.2

Ugh… also! Remember to:

Disable save on edit in project properties.
Restart the IDE after enabling android deployment for the project (not sure if this is still needed or not… used to be)
And Clean & Build the project after the prior two steps.

@BigBob
Ok, the answer is… you have to enable texture atlasing, like in the example above. I forgot that the default images are not power of two and won’t work on many devices. You would want to enable this anyways for android as it make a big difference in performance.

I will most certainly give this a try

@t0neg0d

Still no luck…

I got the android plugin, made the project configuration to run on an android device, turned off save on compile. Restarted the sdk, built the apk, signed the apk, then installed it on my device.

I still only get a black screen with the statistics in the corner.

If I run the jar file it creates, the jar works just fine on my PC.

Here is my current GUI stuff.

I will continue trying different things.

EDIT:

I attempted to remove the statistics display in the corner by putting

    app.setShowSettings(false);
    app.setDisplayStatView(false);

This worked on the jar file it created but didn’t affect the android application at all.

I switched it over to simpleInitApp and still nothing. No matter what it wants to put the statistics in the corner despite changes to the code.

I have no clue what to do at this point.

The statistics show objects and vertices but the rest of the screen is completely blank. Jar file always works properly

@BigBob said: @t0neg0d

Still no luck…

I got the android plugin, made the project configuration to run on an android device, turned off save on compile. Restarted the sdk, built the apk, signed the apk, then installed it on my device.

I still only get a black screen with the statistics in the corner.

If I run the jar file it creates, the jar works just fine on my PC.

Here is my current GUI stuff.

I will continue trying different things.

EDIT:

I attempted to remove the statistics display in the corner by putting

    app.setShowSettings(false);
    app.setDisplayStatView(false);

This worked on the jar file it created but didn’t affect the android application at all.

I switched it over to simpleInitApp and still nothing. No matter what it wants to put the statistics in the corner despite changes to the code.

I have no clue what to do at this point.

The statistics show objects and vertices but the rest of the screen is completely blank. Jar file always works properly

Are you uninstalling the app from your device after? You may be looking at a cached version?

Also, when you say installing… do you mean running the app in USB debug mode? Or?

@t0neg0d

I fixed everything related to the GUI thanks t0neg0d!

1 Like