Software Archive
Read-only legacy content
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17060 Discussions

Splash Screen shows up and shows off very fast

Jonas1
Beginner
834 Views

Hi there!

I went to CORDOVA HYBRID MOBILE APP SETTINGS then Launch Icons and Splash Screes and set:
Launch Icons (MDPI 48x48) and Splash Screens (MDPI 320x470). It is working, but the splash shows up and shows off very fast. How to increase the show off time? Thanks in advance.

Changes in <preference name="SplashScreenDelay" value="N" /> where N is  whatever value that I set at intelxdk.config.additions.xml has no effect at all. 

Intel XDK: 2366
My intelxdk.config.additions.xml:
 <preference name="debuggable" value="false" />
 <preference name="SplashScreenDelay" value="20000" />

Jonas

 

0 Kudos
7 Replies
Amrita_C_Intel
Employee
834 Views

Hello,

Your application cannot call navigator.splashscreen.show() until the app has started and the deviceready event has fired. But since typically the splash screen is meant to be visible before your app has started, that would seem to defeat the purpose of the splash screen. Providing some configuration in config.xml will automatically show the splash screen immediately after your app launch and before it has fully started and received the deviceready event.

Following the link for the suggested changes to config.xml I find that it matches what I have.  What additional parameter needs to be set to display the splash screen before device ready?

 

<splash platform="android" src="android/splash/portrait/splash_320x426.png" density="ldpi" width="320" height="426" orientation="portrait"/>

<splash platform="android" src="android/splash/portrait/splash_320x470.png" density="mdpi" width="320" height="470" orientation="portrait"/>

<splash platform="android" src="android/splash/portrait/splash_480x640.png" density="hdpi" width="480" height="640" orientation="portrait"/>

<splash platform="android" src="android/splash/portrait/splash_720x960.png" density="xhdpi" width="720" height="960" orientation="portrait"/>

<splash platform="android" src="android/splash/landscape/splash_426x320.png" density="ldpi" width="426" height="320" orientation="landscape"/>

<splash platform="android" src="android/splash/landscape/splash_470x320.png" density="mdpi" width="470" height="320" orientation="landscape"/>

<splash platform="android" src="android/splash/landscape/splash_640x480.png" density="hdpi" width="640" height="480" orientation="landscape"/>

<splash platform="android" src="android/splash/landscape/splash_960x720.png" density="xhdpi" width="960" height="720" orientation="landscape"/>

 

The Cordova docs also show the following shich is not present in the XDK version of the XML:

<preference name="SplashScreenDelay" value="10000" />

Or else send me you .zip file

0 Kudos
Swati_S_Intel1
Employee
834 Views

By default the splash screen is displayed for 3 seconds. The purpose of the splashscreen is to show some image while the device is getting ready for app to run instead of showing nitty gritty loading messages. In your code you typically stop showing the splash screen as soon as your device is ready and program is ready to function. You typically use:

function onDeviceReady() {                                        
            if( navigator.splashscreen && navigator.splashscreen.hide ) {   
                navigator.splashscreen.hide() ;
            }
        }

Apparently what you want is exactly opposite, you want your splash screen to be displayed beyond the deviceReady or default 3 seconds. 

To delay the hiding of splashscreen  you  have to add 2 preferences in config.additions.xml. 1) disable the auto hide  and 2) delay the hide

config.additions.xml File :

<preference name="AutoHideSplashScreen" value="false" />
<preference name="SplashScreenDelay" value="5000" />

Also, make sure you remove any references to navigator.splashscreen.hide()  in your code.

0 Kudos
Jonas1
Beginner
834 Views

Hi Swati!

Thanks for your reply!

I have tested it on windows and it worked.

I will put this on hold for a while because I have a new problem and I will try to solve that first. Thanks again.

 

 

0 Kudos
Ulises_V_
Beginner
834 Views

Hi, I have the same problem (my splash screen hides very fast) but I don't see the solution here. My app is IOS and I don't know how can I increase the time for the splash screen.

It is possible?

Thanks

0 Kudos
John_H_Intel2
Employee
834 Views

Have you tried putting this call that is inside onDeviceReady on a setTimeOut?

                navigator.splashscreen.hide() ;
 
0 Kudos
Jonas1
Beginner
834 Views

Yes I have tried navigator.splashscreen.hide()  on a setTimeOut....

If I use like this:

"<head>
     function onDeviceReady() {
       navigator.splashscreen.hide();          
       $.afui.autoLaunch = false; //Set it to false to show a splashscreen
        // This function runs when the content is loaded.
         $(document).ready(function(){
            setTimeout(function(){
                $.afui.launch();
            },1500);
       });
</read>

<body id="afui">
  <div id="splashscreen" class="ui-loader heavy">
   <b style="color:red;">What is the final destination of your used cooking oil?</b>   
   <br><br>
   -oOo-
   <br><br>
   <b style="color:#008000;">Donate two liters of used cooking oil and you might win smartphones.</b>
   <br><br>
   <span class="ui-icon ui-icon-loading spin"></span>
   <h1>Starting Nodirtyenv App</h1> 
  </div>"

works in the xdk emulator only. If I remove the lines up and set it into additions.xml:

<preference name="AutoHideSplashScreen" value="false" />
<preference name="SplashScreenDelay" value="15000" />

works on device, but very very fast....

 

0 Kudos
PaulF_IntelCorp
Employee
834 Views

Do you get different results if you lengthen the timeout? For example, if you change it to 5000 does it take approximately five seconds?

0 Kudos
Reply