Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo SDK Support › Adaptive Icon & Splash Screen best practice (Android)

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #25545

    nks (baumemo)

    Hi Felgo Team,

    we are currently working on make our Felgo App more beautiful. We added Adaptive Icon which also looks great when starting the app.

    Our app needs some time between startup and first clean “Qt draw” so we would like to keep the splash screen for some time (Otherwise we see a black screen for some time).

    We tried this by playing around the splash.xml and AndroidManifest.xml but this looks always ugly (screen designed in splash.xml looks never like the one when have the startup animation using Adaptive Icon). I also checked your apps e.g. (Felgo 4 QML Dev App) and you just draw a black screen (which is also ugly^^). Is there a good solution or a best practice? It seems the solutions provided by Felgo doc are a bit “outdated”.

    Regards

    #25549

    Günther
    Felgo Team

    Hi,

    From the QML UI side you have the option to lazy-load QML-Elements with e.g. Components and Loaders. This helps to reduce startup time for creating all initial QML objects. As a first quick approach you can also add a small Splash-Screen QML-UI while a Loader loads the whole main UI asynchronously.

    Ideally the default operating system splash on iOS/Android side is then rather short. For customizing the OS-Splash there’s not really any specifics from Qt/Felgo side. You can use the options that the native app configuration for each platform offers. There’s no specific Felgo solution for this, so it isn’t really documented and updated on our side.

    #25550

    nks (baumemo)

    Hi Günther,

    I found the following https://developer.android.com/develop/ui/views/launch/splash-screen?hl=de#suspend-drawing .

    In my opinion this will always look not very nice.

     

    I found the following on the android page: https://developer.android.com/develop/ui/views/launch/splash-screen#suspend-drawing .

    This is pretty nice and I tried it by just setting a longer “wait time” by “hacking” the Felgo java files. This works as a prove of concept.

     

    Any chance that we get a feature in Felgo that we can emit a signal from QML to decide when the splashscreen should disappear? This should be a modern approach.

    #25551

    nks (baumemo)
    #25552

    Günther
    Felgo Team

    Hi,

    There’s several ways to integrate native Java with Qt.

    First, there’s the option to extend the main Qt/Felgo Activity with Java custom code. The AndroidManifest currently configures: <activity android:name="com.felgo.helper.FelgoActivity" ...>. You can derive from FelgoActivity in your Java code and load your own Android Activity here then.

    To connect Qt (C++) with Android/Java you have the option to use JNI. Qt has some C++ APIs available for this, e.g. QJniObject and QJniEnvironment.

    For the QML side, the Felgo SDK provides the QML Native Code Components: https://felgo.com/doc/apps-api/#qml-native-code-components
    The components provide a QML wrapper for accessing and working with native Classes and Objects. Here’s an example how to use native APIs for reading the current battery life from the native system (directly from QML without any C++ or JNI code needed): https://felgo.com/doc/apps-api/#qml-native-code-components

    With a combination of these it should be possible to connect some native logic for hiding the splash screen.

    I am not exactly sure how the Android Splashscreen operates in detail, and how the switch between the Splash and the main Activity works. In case the QML UI in the main Activity does not run until the Activity is actually shown, there’s no use in adding a signal from QML side.

    #25553

    nks (baumemo)

    First of all thanks for sharing your knowledge about this topic. I inherited the QtActivity and in the first step simply wait 1 additional second. This already makes the situation much better on most of our test devices. The default flickering behavior of Felgo startup is mostly gone (May be you also wanna do in your Demos?!). I think this is a first good fix for the problem. Making it even depending on a self emitted signal in QML would be even better and will be the next step I will do.

    Thanks Günther for your support. I think this thread is done :).

Viewing 6 posts - 1 through 6 (of 6 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded