I’ve been working for a few days on my first Android application. I finally got it to run smoothely and how I wanted in my game I tried testing out on my android device.
After installing the application using debug usb mode from the SDK the app worked perfectly. So I decided to go to the next step and compile it to an apk.
I compile to apk, sign it, then install the apk from my drop box. Unfortunately this doesn’t work. All it shows is the default statistics in the lower left corner (FPS Vertices Objects Etc)
I have no idea what the difference is or why this is happening.
If I uninstall and reinstall the app using the sdk debug mode, it works just fine, once again.
I really need some help on why my compiled APK doesn’t work, but the SDK’s debug compilation works.
This is my first application and the answer could be obvious or simple.
That is what is so mindblowingly strange to me. I debug the app… Works fine using the sdk debug usb connection.
I compile it. The jarfile works just fine on the desktop while the .apk installed on the device just shows the stats in the corner.
If I uninstall the .apk version and reinstall the debug version from the sdk. Works just fine.
The only thing I do in between is sign the thing, but that shouldn’t make the difference.
The strangest thing to me is that I have the statistics disabled when the application starts. So it’s telling me that the statistics are showing and the main method is never telling it to go away.
But that makes me question… How does the app start without executing the main method.
I’m not great with java, most of my experience comes from the engine. But this just doesn’t seem right to me.
I don’t understand, are you saying add some random text on the app start to see if something is happening?
Yes.
So, to interpret it in more detail since apparently “As a test maybe you can add a regular BitmapText to the guiNode or something…” wasn’t enough.
somewhere in simpleInit
[java]
BitmapText test = new BitmapText(guiFont);
test.setText(“This is a test of some text.”);
test.setLocalTranslation(50, 50, 0);
guiNode.attachChild(test);
[/java]
Ok, if the stats show up and the bitmap text as I pasted doesn’t… then it isn’t really running your code for some reason.
The stats are just bitmap text and they use the same font I suggested. So the only thing I can think of that could be going wrong is that the simpleInit() with the test text just isn’t being run.
When you say “you compile it to apk, then sign it”… That doesn’t sound right. To get a distribution apk the normal way you need to set your keystore settings in the android properties file (Important Files node) and then clean&build the project (not run it). The correct apk is copied to the dist folder of your main project (theres multiple apks created at certain points).