Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Android splash screen Qt 5.5
QtWS25 Last Chance

Android splash screen Qt 5.5

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
splashandroidsplashscreen
2 Posts 2 Posters 3.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • unclebenedictU Offline
    unclebenedictU Offline
    unclebenedict
    wrote on last edited by unclebenedict
    #1

    This is not questions, this answer for me and other users. After start Qt application on android we see black screen, app icon and app name, in process load. For a production this is not be good. Solutions, splash screen. But change AndroidManifest.xml and uncomment

    <meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/splash"/>

    not help for me. Because i see for half seconds, black screen, logo, title app (preload).

    What i do.

    Change AndroidManifest.xml

    add

    <activity
    android:name="org.stir.extension.SplashActivity"
    android:label="@string/app_name"
    android:screenOrientation="portrait"
    android:theme="@android:style/Theme.Black.NoTitleBar" >
    <intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    </activity>

    for a main activity. And uncomment

    <meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/splash"/>

    now we have tow splash screen.

    SplashActivity.java code

    package org.stir.extension;

    import android.app.Activity;
    import android.content.Intent;
    import android.os.Bundle;

    import android.util.Log;

    import android.widget.LinearLayout;
    import android.widget.ImageView;
    import android.view.Window;
    import android.view.WindowManager;

    public class SplashActivity extends Activity
    {
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
    super.onCreate(savedInstanceState);
    this.requestWindowFeature(Window.FEATURE_NO_TITLE);
    this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    setContentView(R.layout.splash);
    Thread logoTimer = new Thread()
    {
    public void run()
    {
    try
    {
    sleep(500);
    startActivity(new Intent("org.stir.extension.AndroidExtension"));
    }
    catch (InterruptedException e)
    {
    e.printStackTrace();
    }
    finally
    {
    finish();
    }
    }
    };
    logoTimer.start();
    }
    }

    SplashActivity run is app activity. We have tow splash screen. If you splash image in SplashActivity and QtActivity will be different. Change QtActivity::onCreate

    //getWindow().setBackgroundDrawable

    and set you resize bipmap. Now i have perfect app preload. Sleep after start activity is not good, but so far i can`t find best solutions.

    1 Reply Last reply
    1
    • benlauB Offline
      benlauB Offline
      benlau
      Qt Champions 2016
      wrote on last edited by
      #2

      See this article to get the instruction to create a splash screen without black screen and show immediately:

      Complete Guide to Making a Splash Screen for your QML Android Application — Medium

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved