菜鸟教程小白 发表于 2022-12-11 20:00:04

android - ionic 2 : What happens during splash screen?


                                            <p><p>我构建了一个 Ionic 2 应用程序,我想知道在应用程序启动屏幕期间究竟发生了什么? </p>

<p>您能否建议我使用高效的分析工具来分析我的应用的所有性能,即使是在这个闪屏期间? </p>

<p>我的应用在生产模式下会在 6 秒内初始化(Honor 6x pro)。我觉得太过分了,你觉得呢?</p>

<p>感谢您的帮助! </p>

<p>我的 config.xml</p>

<pre><code>&lt;?xml version=&#34;1.0&#34; encoding=&#34;UTF-8&#34; standalone=&#34;yes&#34;?&gt;
&lt;widget id=&#34;com.ionicframework.myapp722890&#34; version=&#34;0.0.1&#34; xmlns=&#34;http://www.w3.org/ns/widgets&#34; xmlns:cdv=&#34;http://cordova.apache.org/ns/1.0&#34;&gt;
&lt;name&gt;MyApp&lt;/name&gt;
&lt;description&gt;Mobile version of MyApp&lt;/description&gt;
&lt;author email=&#34;my mail&#34; href=&#34;https://toto/&#34;&gt;toto&lt;/author&gt;
&lt;content src=&#34;index.html&#34;/&gt;
&lt;access origin=&#34;*&#34;/&gt;
&lt;allow-navigation href=&#34;http://ionic.local/*&#34;/&gt;
&lt;allow-navigation href=&#34;http://my-ip:8100&#34;/&gt;
&lt;allow-navigation href=&#34;*&#34;/&gt;
&lt;allow-intent href=&#34;http://*/*&#34;/&gt;
&lt;allow-intent href=&#34;https://*/*&#34;/&gt;
&lt;allow-intent href=&#34;tel:*&#34;/&gt;
&lt;allow-intent href=&#34;sms:*&#34;/&gt;
&lt;allow-intent href=&#34;mailto:*&#34;/&gt;
&lt;allow-intent href=&#34;geo:*&#34;/&gt;
&lt;platform name=&#34;android&#34;&gt;
    &lt;allow-intent href=&#34;market:*&#34;/&gt;
    &lt;icon src=&#34;resources\android\icon\drawable-ldpi-icon.png&#34; density=&#34;ldpi&#34;/&gt;
    &lt;icon src=&#34;resources\android\icon\drawable-mdpi-icon.png&#34; density=&#34;mdpi&#34;/&gt;
    &lt;icon src=&#34;resources\android\icon\drawable-hdpi-icon.png&#34; density=&#34;hdpi&#34;/&gt;
    &lt;icon src=&#34;resources\android\icon\drawable-xhdpi-icon.png&#34; density=&#34;xhdpi&#34;/&gt;
    &lt;icon src=&#34;resources\android\icon\drawable-xxhdpi-icon.png&#34; density=&#34;xxhdpi&#34;/&gt;
    &lt;icon src=&#34;resources\android\icon\drawable-xxxhdpi-icon.png&#34; density=&#34;xxxhdpi&#34;/&gt;
    &lt;splash src=&#34;resources\android\splash\drawable-land-ldpi-screen.png&#34; density=&#34;land-ldpi&#34;/&gt;
    &lt;splash src=&#34;resources\android\splash\drawable-land-mdpi-screen.png&#34; density=&#34;land-mdpi&#34;/&gt;
    &lt;splash src=&#34;resources\android\splash\drawable-land-hdpi-screen.png&#34; density=&#34;land-hdpi&#34;/&gt;
    &lt;splash src=&#34;resources\android\splash\drawable-land-xhdpi-screen.png&#34; density=&#34;land-xhdpi&#34;/&gt;
    &lt;splash src=&#34;resources\android\splash\drawable-land-xxhdpi-screen.png&#34; density=&#34;land-xxhdpi&#34;/&gt;
    &lt;splash src=&#34;resources\android\splash\drawable-land-xxxhdpi-screen.png&#34; density=&#34;land-xxxhdpi&#34;/&gt;
    &lt;splash src=&#34;resources\android\splash\drawable-port-ldpi-screen.png&#34; density=&#34;port-ldpi&#34;/&gt;
    &lt;splash src=&#34;resources\android\splash\drawable-port-mdpi-screen.png&#34; density=&#34;port-mdpi&#34;/&gt;
    &lt;splash src=&#34;resources\android\splash\drawable-port-hdpi-screen.png&#34; density=&#34;port-hdpi&#34;/&gt;
    &lt;splash src=&#34;resources\android\splash\drawable-port-xhdpi-screen.png&#34; density=&#34;port-xhdpi&#34;/&gt;
    &lt;splash src=&#34;resources\android\splash\drawable-port-xxhdpi-screen.png&#34; density=&#34;port-xxhdpi&#34;/&gt;
    &lt;splash src=&#34;resources\android\splash\drawable-port-xxxhdpi-screen.png&#34; density=&#34;port-xxxhdpi&#34;/&gt;
&lt;/platform&gt;
&lt;platform name=&#34;ios&#34;&gt;
    &lt;allow-intent href=&#34;itms:*&#34;/&gt;
    &lt;allow-intent href=&#34;itms-apps:*&#34;/&gt;
&lt;/platform&gt;
&lt;preference name=&#34;webviewbounce&#34; value=&#34;false&#34;/&gt;
&lt;preference name=&#34;UIWebViewBounce&#34; value=&#34;false&#34;/&gt;
&lt;preference name=&#34;DisallowOverscroll&#34; value=&#34;true&#34;/&gt;
&lt;preference name=&#34;android-minSdkVersion&#34; value=&#34;16&#34;/&gt;
&lt;preference name=&#34;BackupWebStorage&#34; value=&#34;none&#34;/&gt;
&lt;preference name=&#34;loadUrlTimeoutValue&#34; value=&#34;60000&#34; /&gt;
&lt;preference name=&#34;SplashMaintainAspectRatio&#34; value=&#34;true&#34;/&gt;
&lt;preference name=&#34;FadeSplashScreenDuration&#34; value=&#34;300&#34;/&gt;
&lt;preference name=&#34;SplashShowOnlyFirstTime&#34; value=&#34;true&#34;/&gt;
&lt;preference name=&#34;SplashScreen&#34; value=&#34;screen&#34;/&gt;
&lt;preference name=&#34;SplashScreenDelay&#34; value=&#34;500&#34;/&gt;
&lt;preference name=&#34;AutoHideSplashScreen&#34; value=&#34;false&#34;/&gt;
&lt;preference name=&#34;FadeSplashScreen&#34; value=&#34;false&#34;/&gt;
&lt;feature name=&#34;StatusBar&#34;&gt;
    &lt;param name=&#34;ios-package&#34; onload=&#34;true&#34; value=&#34;CDVStatusBar&#34;/&gt;
&lt;/feature&gt;
&lt;plugin name=&#34;ionic-plugin-keyboard&#34; spec=&#34;~2.2.1&#34;/&gt;
&lt;plugin name=&#34;cordova-plugin-whitelist&#34; spec=&#34;1.3.1&#34;/&gt;
&lt;plugin name=&#34;cordova-plugin-console&#34; spec=&#34;1.0.5&#34;/&gt;
&lt;plugin name=&#34;cordova-plugin-statusbar&#34; spec=&#34;2.2.1&#34;/&gt;
&lt;plugin name=&#34;cordova-plugin-device&#34; spec=&#34;1.1.4&#34;/&gt;
&lt;plugin name=&#34;cordova-plugin-splashscreen&#34; spec=&#34;~4.0.1&#34;/&gt;
&lt;plugin name=&#34;cordova-sqlite-storage&#34; spec=&#34;~2.0.2&#34;/&gt;
&lt;plugin name=&#34;cordova-base64-to-gallery&#34; spec=&#34;~4.1.2&#34;/&gt;
&lt;plugin name=&#34;mx.ferreyra.callnumber&#34; spec=&#34;~0.0.2&#34;/&gt;
&lt;icon src=&#34;resources\android\icon\drawable-xhdpi-icon.png&#34;/&gt;
&lt;/widget&gt;
</code></pre>

<p>我的 platform.ready 函数:</p>

<pre><code>platform.ready().then(() =&gt; {
      StatusBar.styleDefault();
      Splashscreen.hide();
    });
</code></pre></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>使用 <code>ionic build android --prod</code> 构建可以解决问题。大大减少了应用的初始化时间。</p></p>
                                   
                                                <p style="font-size: 20px;">关于android -ionic2 : What happens during splash screen?,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/44824908/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/44824908/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: android - ionic 2 : What happens during splash screen?