raw beginner here having trouble with android

edited October 2015 in Help request
Hi, I really like your engine because I use C++, and I have been successful in running the demos on Windows, but not on Android.

I followed the tutorials on android and was able to build the library and the demos, but the resulting .apk, when installed, did not work on my Android tablet (it immediately said the app had to close, try again).

The tablet is a Coby Kyros mid-7022 and has Android 2.3 on it. I noticed that the default lowest target on the library and the demos app is Android 2.3.3, so it would seem like the tablet is too low a target. Therefore I tried turning down the lowest target to 2.2(Froyo) in the Project Structure, but the .apk still didn't work.

I haven't tried the orx 1.5 version for android yet, should I try that? Or is the tablet just too old for orx in general?

Comments

  • edited October 2015
    Hi bjorn54 and welcome here!

    I'm afraid I'm not the best qualified for the Android version and its requirements, however I'm sure Lydesik should have the answer you're looking for.

    If you don't have an answer by tomorrow (or if you have other questions or even if you would simply like to chat with us), you can also ping us on http://gitter.im/orx/orx
  • edited October 2015
    Hi bjorn54,

    Welcome! Yes it looks like 2.3 might be just a tad too old. You could try orx 1.5 but I think you would benefit from orx 1.6+ for development.

    But there is a way for you to see where it might be failing on the tablet just to confirm. I use an app called catlog (http://m.fajrnetmarket.store.aptoide.com/app/market/com.nolanlawson.logcat/42/10357963/CatLog). (Check that this app is still trusted!)

    Run catlog, clear the logs, and press the start button. Start the orx demo apk and let it fail. Go back to catlog and pause the logging.

    Scroll through the log looking for the offending message that might help.

    Ultimately it might be worth looking at another tablet or if it might be possible to upgrade at least to 2.3.3.
  • edited October 2015
    Thanks to iarwain and sausage for the responses. Here are some of the CatLog error messages:

    delvikvm L
    Failed resolving Lorg/orxproject/orxtest/OrxDemo$1; interface 815 'Landroid/view/View$onSystemUiVisibilityChangeListener;'

    delvikvm W Link of class 'Lorg/orxproject/orxtest/OrxDemo$1;' failed

    delvikvm E Could not find class 'org.orxproject.orxtest.OrxDemo$1', referenced from method org.orxproject.orxtest.OrxDemo.onCreate

    I'll be looking into getting an update to Android 2.3.3 also.
  • edited October 2015
    Ah yes ok. The android bootstrap code has matured as we have gone along and is probabaly making specific calls that aren't in 2.3. :(

    See how you go with going to 2.3.3. I do some testing on a small mobile phone at home and it has 2.3.3 so I can vouch for that version at least.
  • edited October 2015
    Lol, well it turns out the tablet actually does have android 2.3.3 on it, I looked at the about device info. Sorry about that.

    Because the tablet never came with the store, I just put .apks on it from the internet, so maybe the newer google APIs don't let the tablet run new apps or something.

    Yet it does run quite a few downloaded .apks, so I can't say for sure that it's the fault of the tablet. Perhaps I went overboard with installing Android Studio components. Or underboard.
  • edited October 2015
    While google doesn't like you running apks that aren't from the store, the fact you can select it to run, is a good sign. You and I do the same thing. I have no google store access or account.

    In short, it should run.

    I can organise a good apk if you'd like to try it on your device? In fact we should have these available at all times anyway.
  • edited October 2015
    Sure that would be helpful, thanks.
  • edited October 2015
    I don't have one on this laptop but you can test it using one of my pinball apks: http://hippocket.waynejohnson.net

    There's a couple of direct apk downloads. See if they install and run for you. If not, I'll try to compile up a demo for you.
  • edited October 2015
    Thank you, the raster blaster worked fine. Recently I've been thinking that I need to start over and make sure I match bit-ness of Android Studio with the NDK.
  • edited October 2015
    bjorn, could you send the apk you've compiled?
  • edited October 2015
    Ok I see the issue...

    First orx should works fine on Android 2.3.0, there is no API changes between Android 2.3.0 and 2.3.3 (only bug fix)

    In the OrxDemo Activity, I'm installing a OnSystemUiVisibilityChangeListener on the mDecorView.

    But OnSystemUiVisibilityChangeListener class doesnt exists before Android 3.0. so the import fails.

    Just remove all references to OnSystemUiVisibilityChangeListener in OrxDemo and it should work.

    I'll work on a fix for this case.

    hope it'll help
  • edited October 2015
    Thank you enobayram and lydesik for the responses.

    I decided to start over from scratch for a clean build, this time making sure to create a shortcut to the 32-bit version of Android Studio. After following all the instructions, the result was...a working apk.

    The walls were moving, the guys were bouncing off the walls and falling down, and the music and sound effects were playing.

    Thanks to everyone to being part of my first successful build of something with an engine on android! :)

    P.S. to lydesik: I'm using and was successful with the c48663d581b5 version when I made sure to use 32-bit studio.
  • edited October 2015
    Glad to hear it works for you now and welcome to the community :)
Sign In or Register to comment.