Phonegap App Hides Screen Saver Too Fast

I am developing a multi-platform Phonegap application and use the Phonegap Build service to create and download it to devices. I followed the documentation and looked through it many times online, but I'm still having problems with the screen saver. The application launches and displays a splash screen for about 1 second, then a white flash appears, and sometimes there is also a flash of uneven html before the page loads properly. I try to make the splashscreen last about 4 seconds, and then correctly display the start page without these annoying flashes - they have such a negative effect on the user interface and make it really different from a mobile application. I can’t get any of the suggested elements in the config.xml file to work to indicate a screen saver delay.

I tested this on iPad 2, iPhone 4 and the latest Google Nexus, and all 3 devices have this problem, the iPhone is the slowest, and Nexus shows a very fast flash, but nonetheless a flash nonetheless.

I use the latest version of Phonegap Build and jQuery mobile for the interface and page transitions, so I wonder if this is related to this.

Any help is much appreciated!

+4
source share
5 answers

Try this for Android:

SplashScreenDelay (number in milliseconds, default is 3000) . Screen saver image display time.

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

Install this <preference>inside the res--> xml -->config.xmlfile.

Source link here.

+1

config.xml

<preference name="SplashScreen" value="splash" />
<preference name="SplashScreenDelay" value="10000" />
<preference name="AutoHideSplashScreen" value="false" />

, .js

navigator.splashscreen.hide();
+1

, , , - HTML WWW . j Query . java script , , .

0

,

navigator.splashscreen.hide();

( , /)

fastdom, , ,

fastdom.defer(2, function () {
    navigator.splashscreen.hide();
});
0

, , config.xml,

<preference name="SplashScreen" value="splash" />
<preference name="SplashScreenDelay" value="10000" />
<preference name="AutoHideSplashScreen" value="false" />

navigator.splashscreen.hide();

when you are ready to hide your screensaver. But make sure you add the splashscreen plugin:

cordova plugin add cordova-plugin-splashscreen

since the splash screen will show (at least on iOS, and not 100% if the firewall works without a plug-in on other platforms) without it, but you can’t control the duration or hiding it without a plug-in.

0
source

Source: https://habr.com/ru/post/1539903/


All Articles