Splash Screen on Android


I’m just playing a bit to try to get and Splash Screen working on Android. This is my approach (Based on a similar splash screen that works on NativeScript):

  1. Modify the styles.xml on the build/Android/Debug//app/src/main/res/styles.xml
  <style name="ApplicationTheme" parent="@android:style/Theme.Holo">


  <style name="SplashScrTheme" parent="ApplicationTheme">
          <item name="android:windowActionBar">false</item>
          <item name="android:windowNoTitle">true</item>
          <item name="android:windowContentOverlay">@null</item>
          <item name="android:windowBackground">@drawable/splashscreen</item>

	<style name="AppTheme" parent="ApplicationTheme">
		<item name="android:windowIsTranslucent">true</item>
		<item name="android:windowBackground">@android:color/transparent</item>

  1. Modify the build/Android/Debug//app/src/main/AndroidManifest.xml file to use the SplashScrTheme
        <activity android:name="splashsample"
  1. Modify the build/Android/Debug//app/src/main/java/com/apps//.java on the onCreate method
    protected void onCreate(Bundle savedInstanceState)
        // mandatory call to super

The idea is that instead of a transparent window, show a screen with a background image as splash and when the activity is created, change the theme.

The problem is that every time i build, the changes made reverted to default. Any idea about how can i test this idea?



PS: I get my “inspiration” on this article: https://www.nativescript.org/blog/splash-screen-for-your-android-applications

I might misunderstand what you are trying to achieve, but there are several threads on creating a splash screen in pure Fuse without modifying the build files, such as the “Hikr” tutorial in our Docs-section as well as this: https://www.fusetools.com/community/forums/howto_discussions/how_do_i_create_a_splashscreen?page=1&highlight=6d5de86a-c042-4bab-85b6-8751f8b995a0#post-6d5de86a-c042-4bab-85b6-8751f8b995a0


Thanks! I read the tutorial, and yes, it works, and tried it, but it;s intended to show a splash for x secconds, no matter how long takes to load the app, and it shows only when the app is loaded. It’s only a delay.

My approach is different and exclusive of Android. On iOS the Splash Screen is easy to show a splash while the App is loading. I want to do something like this on Android.

I notice that when app loads on Android, the default theme shows an transparent screen:

    <style name="AppTheme" parent="ApplicationTheme">
        <item name="android:windowIsTranslucent">true</item>
        <item name="android:windowBackground">@android:color/transparent</item>

My idea is to default set the theme to a splash theme, and when the Activity loads, change the theme to the default. So, when the app loads it shows a logo or something.



Ah, then I get what you are asking for. :slight_smile: It is indeed very simple on iOS (it’s called “Launch image” and you set it directly in Xcode). AFAIK, Android does not come with such an option (or at least it didn’t use to at least), and it doesn’t seem to be a part of the design guidelines either.

TL;DR: sorry I couldn’t be of more help. Your idea might indeed work, but yes, it looks like it’ll involve hacking on the files on each build.

For many my Android apps i use this tutorial, short and simple Splash screen on Android

  1. styles.xml
    <style name="AppTheme" parent="@style/Theme.AppCompat.Light">
        <item name="windowNoTitle">true</item>
        <item name="android:windowIsTranslucent">false</item>
        <item name="android:windowBackground">@drawable/background_splash</item>
  1. background_splash.xml (Replace android:src="@mipmap/icon" with your value)
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
  1. colors.xml
<?xml version="1.0" encoding="utf-8"?>
    <color name="white">#FFFFFF</color>
  1. Splash.uxl
<Extensions Backend="CPlusPlus" Condition="Android">
    <CopyFile Name="background_splash.xml" TargetName="app/src/main/res/drawable/background_splash.xml" />
    <CopyFile Name="styles.xml" TargetName="app/src/main/res/values/styles.xml" />
    <CopyFile Name="colors.xml" TargetName="app/src/main/res/values/colors.xml" />