Reputation: 1614
I Developed many apps using ionic 2 and I had rough times with the splash screen. The splash screen takes a lot of time to disappear, I know this depends on the number of the plugins and the time each take to respond. So the problem is how can I delete the waiting of the splash screen or at least reduce it to only one second. Is there any kind of memory management configuration to add to the app so that it doesn't have to restart each time you open the app? I am open to more ideas if you have any.
Thank you
Upvotes: 1
Views: 1148
Reputation: 75
You need to use right CLI for that. Use below one:
debug mode: This CLI supports AOT
ionic cordova run android --prod --device
release mode:
ionic cordova build android --prod --release
You can see http://ionicframework.com/docs/cli/cordova/build/
Upvotes: 2
Reputation: 6421
There's some things you can do to lower the time it takes the app to fully load so the splash screen goes off early.
As said by Nguyen building an app with --prod
flag (ionic cordova build android --prod
) can help you. When building in production ionic do some additional steps like optimizing js, minifying css, minifying js and aot (ahead of time) architecture.
These can also be used with a normal building in case you want to test something in development mode, using flags like --minifyjs
, --minifycss
, --optimizejs
, --aot
.
Another thing you can do is using enableProdMode()
so when angular builds it'll turn off some checkings and assertions from the framework. To do this in your app.ts
file inside app
folder do
import { enableProdMode } from '@angular/core';
enableProdMode();
Hope this helps you.
Upvotes: 1
Reputation: 533
Build with option --prod. Note that it's longer than 1 second. Depends on hardware, app...
Upvotes: 1