Quantcast
Channel: SCN: Message List - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 8124

Re: SAPUI5 Mobile Splash Screen

$
0
0

Hi Simon,

 

 

well, first of all, it should not be required to load > 2.5 MB. Is gzip enabled for all relevant file types on your server? The POA app (https://openui5.hana.ondemand.com/test-resources/sap/m/demokit/poa/index.html#) comes in at 764 kB (which is still too much, I know) and a third of this is the huge icon font, but this app should have about everything yours has.

 

Still, loading can be slow and indeed it makes sense to display a loading screen NOT using UI5 when it is supposed to bridge the time while UI5 is loading.

One option is to add some plain HTML and CSS to the page, displaying an image or animation. Inline image in CSS, or even better in index.html, or a CSS animation would be preferred to avoid extra requests.

However, the browser only starts rendering the <body> once it is done processing the <head>. So if you load UI5 normally in the head, it could be that still everything is loaded synchronously before the browser goes on parsing the body and finally displaying something.

 

The solution for this is the async preload mode, see https://openui5.hana.ondemand.com/docs/guide/Bootstrap.html

In this mode UI5 (well, at least the libraries) is loaded asynchronously, so the browser can continue parsing the document without waiting for UI5 to load and init. This will help you to see something much faster. The one thing you have to do in this mode: you cannot use UI5 right away in the head, obviously, but you have to register for the Core's "init" event:

sap.ui.getCore().attachInit(function() {

    // now your app can start using UI5

});

 

One could continue to optimize on top of this, e.g. also load the UI5 core asynchronously, but maybe the above already helps.

 

Regards

Andreas


Viewing all articles
Browse latest Browse all 8124

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>