android – 如何在设备上运行时加快Ionic 2应用程序的启动时间

android – 如何在设备上运行时加快Ionic 2应用程序的启动时间,第1张

概述我目前正在做一个带有离子2 angular2和Typescript的应用程序.在启动我的应用程序的速度时,我有一个很大的问题.当我为dev或prod环境构建应用程序并将其安装在任何设备上时,需要花费大量时间来加载. 当我启动应用程序时,它显示一个长时间停留的白色屏幕,这真的很烦人,因为用户不会等待那么长时间. 我确实删除了splashscreen cordova插件,并在config.xml中将s 我目前正在做一个带有离子2 angular2和Typescript的应用程序.在启动我的应用程序的速度时,我有一个很大的问题.当我为dev或prod环境构建应用程序并将其安装在任何设备上时,需要花费大量时间来加载.

当我启动应用程序时,它显示一个长时间停留的白色屏幕,这真的很烦人,因为用户不会等待那么长时间.

我确实删除了splashscreen cordova插件,并在config.xml中将splashscreen延迟更改为0,但仍然需要花费很多时间才能加载.

在启动我的应用程序时,只会执行几个Get请求.
这是我目前的Config.xml

<Widget ID="com.ionicframework.comvltapp596066" version="0.0.1" xmlns="http://www.w3.org/ns/Widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">    <name>com.vlt.app</name>    <description>An awesome Ionic/Cordova app.</description>    <author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author>    <content src="index.HTML" />    <access origin="*" />    <allow-navigation href="http://ionic.local/*" />    <allow-intent href="http://*/*" />    <allow-intent href="https://*/*" />    <allow-intent href="tel:*" />    <allow-intent href="sms:*" />    <allow-intent href="mailto:*" />    <allow-intent href="geo:*" />    <preference name="webvIEwbounce" value="false" />    <preference name="UIWebVIEwBounce" value="false" />    <preference name="disallowOverscroll" value="true" />    <preference name="androID-minSdkVersion" value="16" />    <preference name="BackupWebStorage" value="none" />    <preference name="SplashMaintainAspectRatio" value="true" />    <preference name="FadeSplashScreenDuration" value="2" />    <preference name="SplashShowOnlyFirstTime" value="true" />    <preference name="SplashScreen" value="screen" />    <preference name="SplashScreenDelay" value="0" />    <platform name="androID">        <allow-intent href="market:*" />        <icon density="ldpi" src="resources/androID/icon/drawable-ldpi-icon.png" />        <icon density="mdpi" src="resources/androID/icon/drawable-mdpi-icon.png" />        <icon density="hdpi" src="resources/androID/icon/drawable-hdpi-icon.png" />        <icon density="xhdpi" src="resources/androID/icon/drawable-xhdpi-icon.png" />        <icon density="xxhdpi" src="resources/androID/icon/drawable-xxhdpi-icon.png" />        <icon density="xxxhdpi" src="resources/androID/icon/drawable-xxxhdpi-icon.png" />        <splash density="land-ldpi" src="resources/androID/splash/drawable-land-ldpi-screen.png" />        <splash density="land-mdpi" src="resources/androID/splash/drawable-land-mdpi-screen.png" />        <splash density="land-hdpi" src="resources/androID/splash/drawable-land-hdpi-screen.png" />        <splash density="land-xhdpi" src="resources/androID/splash/drawable-land-xhdpi-screen.png" />        <splash density="land-xxhdpi" src="resources/androID/splash/drawable-land-xxhdpi-screen.png" />        <splash density="land-xxxhdpi" src="resources/androID/splash/drawable-land-xxxhdpi-screen.png" />        <splash density="port-ldpi" src="resources/androID/splash/drawable-port-ldpi-screen.png" />        <splash density="port-mdpi" src="resources/androID/splash/drawable-port-mdpi-screen.png" />        <splash density="port-hdpi" src="resources/androID/splash/drawable-port-hdpi-screen.png" />        <splash density="port-xhdpi" src="resources/androID/splash/drawable-port-xhdpi-screen.png" />        <splash density="port-xxhdpi" src="resources/androID/splash/drawable-port-xxhdpi-screen.png" />        <splash density="port-xxxhdpi" src="resources/androID/splash/drawable-port-xxxhdpi-screen.png" />    </platform>    <platform name="ios">        <allow-intent href="itms:*" />        <allow-intent href="itms-apps:*" />        <icon height="57" src="resources/ios/icon/icon.png" wIDth="57" />        <icon height="114" src="resources/ios/icon/icon@2x.png" wIDth="114" />        <icon height="40" src="resources/ios/icon/icon-40.png" wIDth="40" />        <icon height="80" src="resources/ios/icon/icon-40@2x.png" wIDth="80" />        <icon height="120" src="resources/ios/icon/icon-40@3x.png" wIDth="120" />        <icon height="50" src="resources/ios/icon/icon-50.png" wIDth="50" />        <icon height="100" src="resources/ios/icon/icon-50@2x.png" wIDth="100" />        <icon height="60" src="resources/ios/icon/icon-60.png" wIDth="60" />        <icon height="120" src="resources/ios/icon/icon-60@2x.png" wIDth="120" />        <icon height="180" src="resources/ios/icon/icon-60@3x.png" wIDth="180" />        <icon height="72" src="resources/ios/icon/icon-72.png" wIDth="72" />        <icon height="144" src="resources/ios/icon/icon-72@2x.png" wIDth="144" />        <icon height="76" src="resources/ios/icon/icon-76.png" wIDth="76" />        <icon height="152" src="resources/ios/icon/icon-76@2x.png" wIDth="152" />        <icon height="167" src="resources/ios/icon/icon-83.5@2x.png" wIDth="167" />        <icon height="29" src="resources/ios/icon/icon-small.png" wIDth="29" />        <icon height="58" src="resources/ios/icon/icon-small@2x.png" wIDth="58" />        <icon height="87" src="resources/ios/icon/icon-small@3x.png" wIDth="87" />        <splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" wIDth="640" />        <splash height="1334" src="resources/ios/splash/Default-667h.png" wIDth="750" />        <splash height="2208" src="resources/ios/splash/Default-736h.png" wIDth="1242" />        <splash height="1242" src="resources/ios/splash/Default-Landscape-736h.png" wIDth="2208" />        <splash height="1536" src="resources/ios/splash/Default-Landscape@2x~ipad.png" wIDth="2048" />        <splash height="2048" src="resources/ios/splash/Default-Landscape@~ipadpro.png" wIDth="2732" />        <splash height="768" src="resources/ios/splash/Default-Landscape~ipad.png" wIDth="1024" />        <splash height="2048" src="resources/ios/splash/Default-Portrait@2x~ipad.png" wIDth="1536" />        <splash height="2732" src="resources/ios/splash/Default-Portrait@~ipadpro.png" wIDth="2048" />        <splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" wIDth="768" />        <splash height="960" src="resources/ios/splash/Default@2x~iphone.png" wIDth="640" />        <splash height="480" src="resources/ios/splash/Default~iphone.png" wIDth="320" />    </platform>    <engine name="androID" spec="^6.2.3" />    <engine name="browser" spec="^4.1.0" />    <plugin name="cordova-plugin-console" spec="1.0.5" />    <plugin name="cordova-plugin-device" spec="1.1.4" />    <plugin name="cordova-plugin-Googlemaps" spec="^1.4.0">        <variable name="API_KEY_FOR_ANDROID" value="AIzaSyALRGE9KkSD9Qpng8XR7vUaVNj1teJGhw4" />    </plugin>    <plugin name="cordova-plugin-inappbrowser" spec="^1.7.1" />    <plugin name="cordova-plugin-statusbar" spec="2.2.2" />    <plugin name="cordova-plugin-whiteList" spec="1.3.1" />    <plugin name="cordova-sqlite-storage" spec="^2.0.4" />    <plugin name="ionic-plugin-keyboard" spec="~2.2.1" /></Widget>

请帮忙!

解决方法 根据经验,我会说在Ionic应用程序中启动时间没有显着改善,但是从我收集的在线文章中,您可以优化您的Ionic应用程序以启动和更快地工作.

>必要时,优先选择Ionicons
>检查并确保您的JavaScript文件移动到页面底部
>不要使用像Jquery这样的不必要的库.
>使用更少的页面或以其他方式学习重用页面.
> Ionic 3还引入了延迟加载,以避免在启动时加载所有组件.

查看this链接了解更多详情

总结

以上是内存溢出为你收集整理的android – 如何在设备上运行时加快Ionic 2应用程序的启动时间全部内容,希望文章能够帮你解决android – 如何在设备上运行时加快Ionic 2应用程序的启动时间所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1122609.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-29
下一篇 2022-05-29

发表评论

登录后才能评论

评论列表(0条)

保存