- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I want to change the splash screen duration value in my app because I feel the loading time of splash screen in my app is little bit longer before the app index page is loaded. I tried to add the the value "<preference name="splash-screen-duration" value="100000" />" to make the splash screen disappear earlier in the file "intelxdk.config.additions.xml'', but it didn't work. I know it is not allowed to change the directives in the auto-generated file " intelxdk.config.android.xml". According to the link (https://software.intel.com/en-us/xdk/docs/using-the-cordova-for-android-ios-etc-build-option), it seems I only can modify the directives listed in the auto-generated config. xml file So, is it possible to change the duration value of splash screen in intel xdk? Thanks a lot in advance.
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Which system are you building for? Android or iOS? I believe that preference only works with Android. Do you have the splash screen plugin added to your project?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Paul,
I am building an app for android. I added the splash plugin in my app. I also added this line "<preference name="splash-screen-duration" value="100000" />" in the file "intelxdk.config.additions.xml', but it didn't work on my android 4.4 phone unfortunately. BTW, I use the method "navigator.splashscreen.hide()" rather than "intel.xdk.device.hideSplashScreen()"to hide the splash screen in my js. Any ideas? Thanks a lot.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When you call the navigator.splashscreen.hide() function it short circuits the preference in the config.xml file. So if you want the preference to have priority you should remove the reference to the hide() function. Are you using the code from the template in init-app.js or did you roll your own? Either way, the call which happens after the cordova ready event will undo the preference settings (assuming it happens before the preference timeout).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Paul,
I call the splash screen hide function in a fairly simple js function as below. I didn't use the default one (xdk.device.hideSplashScreen()) in cordova-init.js. Now, I removed the function in my app and added the line "<preference name="splash-screen-duration" value="100000" />" in the file "intelxdk.config.additions.xml. However, the duration of splash screen is even longer than the previous one. It seems that setting the duration value of splash screen won't work anyway.
function onDeviceReady() { navigator.splashscreen.hide(); }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have you tried adding a setTimeout to the splashscreen.hide call? It will delay the call for specified number of ms.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@John, excellent suggestion :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi John,
I tried it without luck. It seems it will further delay hiding the splash screen. Although the function "navigator.splashscreen.hide()" is not very ideal, it is still faster than the default one.
function onDeviceReady() { setTimeout(function() { navigator.splashscreen.hide(); }, 30); }
and
function onDeviceReady() { setTimeout( navigator.splashscreen.hide(), 30); }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok, lets rewind here.
Can you explain exactly what your issue is? Does the splashscreen go away to soon? Last to long? Does it go away and the page is not finished loading yet, so it goes away and you the app looks like its still loading? Are you loading remote content to display your main page?
Sorry for all the questions, just trying to get the root of what you are doing/what you want to do/what you are getting.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi John,
The issue is the splash screen last too long. It is still there after my index page is loaded. I want it to disappear before my index page is loaded. I tried the methods mentioned above but it didn't work. Thanks a lot for help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'll definitely try it and thanks a lot for your patience and help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No problem. I was installing on an iPhone 6. Let me know how you make out.
![](/skins/images/872293744008A34B36F8ABF94A46CC66/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page