How to have a splash screen in android application built with QML?



  • Hi All,
    how i can have a splash screen in Qt for android apps.

    Note:i have tried creating splash screen using "QSplashScreen " ,but i guess it is not a proper way of doing it for android because you can observe a flicker after showing the splash ,also for this i have to add widget (QT += widgets )module into .pro file which i don't want to do,also it requires "QApplication " in main file but iam using "QGuipplication" .



  • Hi.

    You can create a splash screen by creating a new QML file (splashscreen.qml for example) and simply have an image in it that is loaded (for speed sake) from the resource file (compiled into the executable).

    Then in your main.qml, show that splash screen with a timer while you load your other resources asynchronously.

    So long story short, a splash screen is nothing more than a qml Item with an image in it, shown at the start of the app and hidden whenever loading (whatever that is) is finished.


  • Moderators

    @divaindie
    If you want a custom splash screen for android, usually there's a white screen with the application name by default before the actual app is completely loaded, you'll have to add that in the manifest file.

    The manifest file created by QtCreator for example has the correct method in it already but IIRC it's commented out:

    For example:

                <!-- Splash screen -->
                <meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/launch_logo"/>
                <!-- Splash screen -->
    


  • i feel this link is useful !!!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.