Reduce download time in ionic-2 application

I am new to ionic-2 project. I just want to know how to reduce application loading time. Since after 3 seconds of the screen saver a white screen appears and it takes 9 seconds to start.

+6
source share
5 answers

Try putting this on the second line of your main.ts file

import { enableProdMode } from '@angular/core';

and then before the download bar loads

enableProdMode();

also when using the building --prod , therefore ionic build android --prod

+14
source

To reduce the screen saver time, follow these steps: -

First delete the node_modules folder Delete any Temp folder Delete the plugins folder remove the android platform using ionic platform rm android . Now reinstall everything: -

(i) npm install (ii) ionic serve (iii) ionic platform add android

Now run this command FINALLY ionic build android --prod

IT WORKS 100% PERFECT.

If that doesn't work, don't give up. Try the steps 2 to 3 times, I'm sure it will work.

+4
source

I had a very similar problem with a white screen, look here for progress. Cordoba, Android, incredibly slow loading

Short version This is a slow boot due to the many reasons mentioned above by Fernando. You can work on a yes resolution, but for a white screen ... Android will hide the splash screen while the application is still loading. To fix this problem, you can add below to your configuration;

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

This will ensure that the splash screen remains at least 10 seconds while the application is loading, rather than automatically hiding. Then, in the main component of your launcher, make sure you have the following to hide the splash screen when the application really starts and you're done. obviously requires the cordova-splash-screen plugin, which sends by default using ionic2.

 platform.ready().then(() => { Splashscreen.hide(); }); 
+1
source

Even I had the same problem. After reading the forum on the ion team, I understand that the ion team has not yet come up with any solution.

I made the following code, which minimizes the application, and does not close it, so that the next time you open the application, it instantly opens.

Put the code below in the app.component.ts file

 this.platform.registerBackButtonAction(() => { if(this.menuCtrl.isOpen()){ this.menuCtrl.close(); } else if(this.nav.canGoBack()){ this.nav.pop(); }else{ this.appMinimize.minimize(); } }); 

You may need to install @ ionic-native / app-minim

links for reference:

https://ionicframework.com/docs/api/platform/Platform/#registerBackButtonAction https://ionicframework.com/docs/native/app-minimize/

0
source

Please enable production mode in main.ts file, for example

 import {enableProdMode} from '@angular/core'; enableProdMode(); 
0
source

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


All Articles