Important: Please read the Qt Code of Conduct -

Qt + Android + Irrlicht. Need to get android_app*

  • Hi all.
    I've built Irrlicht folowing this guide:
    27.HelloWorld_Android example of Irrlicht works nice on my phone.
    But now I try to port project, which uses Irrlicht, to Android with my built Irrlicht lib.
    This lib uses android_app* which it gets from
    void android_main(android_app* app)
    I don't provide it, so my irrlicht widget crashes.

    What is the simplest way to solve it?
    Is there any way to get android_app pointer without android_main or rewriting irrlicht source code?

    edited: I think a main question is "How can I obtain android_app* in Qt?"

  • Lifetime Qt Champion


    I haven't use Irrlicht but shouldn't you rather try to run Irrlicht in a QWindow/QWidget ?

  • I use QWidget over Irrlicht and it works fine with desktop version of Irrlicht lib.
    The problem is that android irrlicht lib expects android_app* pointer in parameters. android_app* is provided by android_main function. And I see 3 ways to solve it:

    1. obtain android_app* in Qt and provide it in parameters. So the question - how to obtain it?
    2. rewrite some source code of irrlicht android lib, but I think it's wrong way
    3. try to build android lib from desktop irrlich lib source code by ndk-build, but I think it's worse than 2nd way.

  • Lifetime Qt Champion

    You can also try asking the Irrlicht devs to see if they came across that use case.

    One other source of information is the Android-development mailing list You'll find there Qt's Android port developers/maintainers (this forum is more user oriented)

Log in to reply