<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">compared performance of re-opening of
      native Android apps and Qt Android apps:<br>
      <br>
      Native Android apps open immediately - doesn't matter if minimized
      by BACK, HOME or OVERVIEW Button. <br>
      Qt Android apps open immediately if minimized by HOME or OVERVIEW
      Button, but if closed by BACK it took some time.<br>
      Seems Android caches some things and Qt Android are re-loading
      stuff.<br>
      <br>
      Of course if BACK Button is used App is at same state as a fresh
      App - doesn't matter if native Android or Qt Android.<br>
      <br>
      So if your app needs some time for first time opening, same time
      will be needed if re-opening after exiting with BACK.<br>
      To avoid this, overwrite BACK Button Behavior from
      Keys.onBackPressed:<br>
      Open a Dialog asking the user if App should be exited. Perhaps add
      some info that leaving the app using HOME or OVERVIEW will re-open
      app faster.<br>
      <br>
      Have no idea if you  can trigger the HOME Button if BackPressed<br>
      <br>
      ekke<br>
      <br>
      Am 15.06.16 um 09:16 schrieb ekke:<br>
    </div>
    <blockquote
      cite="mid:a09c03bc-d7aa-e3a1-72c9-ac14556a8d7f@ekkes-corner.org"
      type="cite">
      <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
      <div class="moz-cite-prefix">Am 15.06.16 um 08:00 schrieb Лагнер,
        Сергей:<br>
      </div>
      <blockquote
cite="mid:CA+GvNnzu5zBXeNS9i62+Vov-dryaopMP7ZCoe4P6KhbeKSE6_Q@mail.gmail.com"
        type="cite">
        <div dir="ltr">
          <div>Indeed. I have checked it carefully. I call QApplication
            quit if my StackView has the last Page. </div>
          <div>But what should I do to hide the app once user presses
            the back button?</div>
        </div>
      </blockquote>
      just noticed:<br>
      if app becomes inactive because user uses Home or Overview Button,
      re-opening is very fast<br>
      if user uses BACK button app is closed and re-opening took a long
      time<br>
      <br>
      you can overwrite BACK behavior:<br>
      <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">        </span><span style=" color:#800000;">Keys.onBackPressed</span>:<span style=" color:#c0c0c0;"> </span>{</pre>
      <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">            </span>event.accepted<span style=" color:#c0c0c0;"> </span>=<span style=" color:#c0c0c0;"> true</span><span style=" font-style:italic; color:#000000;"></span></pre>
      <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">            </span><span style=" color:#008000;">//</span><span style=" color:#c0c0c0;"> ...</span></pre>
      <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">        </span>}</pre>
      <br>
      But I don't know how to set the correct state now to avoid closing
      the app from BACK and doing the same as from HOME<br>
      <br>
      ekke
      <blockquote
cite="mid:CA+GvNnzu5zBXeNS9i62+Vov-dryaopMP7ZCoe4P6KhbeKSE6_Q@mail.gmail.com"
        type="cite">
        <div class="gmail_extra"><br>
          <div class="gmail_quote">2016-06-15 1:57 GMT+06:00 Xavier
            Bigand <span dir="ltr"><<a moz-do-not-send="true"
                href="mailto:flamaros.xavier@gmail.com" target="_blank">flamaros.xavier@gmail.com</a>></span>:<br>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div dir="ltr">I don't really understand, because if the
                process isn't killed Android don't release anything that
                you have loaded. So normally when the OS put the
                application back to the active state it should be really
                fast.
                <div><br>
                </div>
                <div>With our app we don't have a such issue.</div>
                <div><br>
                </div>
                <div>Maybe you catch the back button in QML or C++ and
                  you call the QApplication quit method or something
                  else that finally make your application exiting.</div>
                <div><br>
                </div>
                <div>Try to launch your app with a debugger, you'll see
                  in the console if the process is killed when pressing
                  the back button.</div>
              </div>
              <div class="gmail_extra">
                <div>
                  <div class="h5"><br>
                    <div class="gmail_quote">2016-06-14 21:31 GMT+02:00
                      Лагнер, Сергей <span dir="ltr"><<a
                          moz-do-not-send="true"
                          class="moz-txt-link-abbreviated"
                          href="mailto:developer@lagner.ru"><a class="moz-txt-link-abbreviated" href="mailto:developer@lagner.ru">developer@lagner.ru</a></a>></span>:<br>
                      <blockquote class="gmail_quote" style="margin:0 0
                        0 .8ex;border-left:1px #ccc
                        solid;padding-left:1ex">
                        <div dir="ltr">
                          <div>Thank you for advice</div>
                          <div><br>
                          </div>
                          <div>We are already doing our best to optimize
                            QML loading time. We use Loaders from QML
                            side </div>
                          <div>and lazy loading for models from C++
                            side. But the application still too heavy. </div>
                          <div>It takes 6 sec approximately to launch on
                            Nexus 5. </div>
                          <div><br>
                          </div>
                          <div>Therefore we are looking for other ways
                            to improve our app. </div>
                          <div><br>
                          </div>
                          <div>Now I'm care about warm start. </div>
                          <div><br>
                          </div>
                          <div>Lets consider the following scenario:</div>
                          <div>- I launch the app. It takes 6 sec.</div>
                          <div>- Press back and see a home screen</div>
                          <div>- Launch the app again in a second. And
                            again it takes 6 sec.  </div>
                          <div><br>
                          </div>
                          <div>That is mean that all resources were
                            freed and second start was completely from
                            scratch. </div>
                          <div>I wonder if I could speed up the
                            second(warm) start from java side. </div>
                          <div>For example, is it possible so save
                            preloaded native libraries until the OS has
                            the real lack of memory?</div>
                        </div>
                        <div>
                          <div>
                            <div class="gmail_extra"><br>
                              <div class="gmail_quote">2016-06-14 21:56
                                GMT+06:00 Xavier Bigand <span dir="ltr"><<a
                                    moz-do-not-send="true"
                                    class="moz-txt-link-abbreviated"
                                    href="mailto:flamaros.xavier@gmail.com"><a class="moz-txt-link-abbreviated" href="mailto:flamaros.xavier@gmail.com">flamaros.xavier@gmail.com</a></a>></span>:<br>
                                <blockquote class="gmail_quote"
                                  style="margin:0 0 0
                                  .8ex;border-left:1px #ccc
                                  solid;padding-left:1ex">
                                  <div dir="ltr">Hi,
                                    <div><br>
                                    </div>
                                    <div>If you are using QML you may
                                      have to use Loaders to avoid
                                      loading of GUI parts that are not
                                      displayed directly.</div>
                                    <div>You can also take a look to the
                                      QtQuick compiler to improve qml
                                      loading.</div>
                                    <div>There is a profiler on
                                      QtCreator for QML which can help
                                      you to find your binding that are
                                      slow, be sure to not having
                                      binding loops.</div>
                                  </div>
                                  <div class="gmail_extra"><br>
                                    <div class="gmail_quote">
                                      <div>
                                        <div>2016-06-14 16:33 GMT+02:00
                                          Лагнер, Сергей <span
                                            dir="ltr"><<a
                                              moz-do-not-send="true"
                                              class="moz-txt-link-abbreviated"
href="mailto:developer@lagner.ru"><a class="moz-txt-link-abbreviated" href="mailto:developer@lagner.ru">developer@lagner.ru</a></a>></span>:<br>
                                        </div>
                                      </div>
                                      <blockquote class="gmail_quote"
                                        style="margin:0 0 0
                                        .8ex;border-left:1px #ccc
                                        solid;padding-left:1ex">
                                        <div>
                                          <div>
                                            <div dir="ltr">
                                              <div>Hi all.</div>
                                              <div><br>
                                              </div>
                                              <div>I'm trying to
                                                optimize start time of
                                                my android application.
                                                For now I'm interested
                                                in warm start time </div>
                                              <div>when the user presses
                                                back and quickly returns
                                                to the app. If we
                                                consider java
                                                application the </div>
                                              <div>warm start is faster,
                                                it seems like android
                                                caches something or so.</div>
                                              <div>But it does not work
                                                for Qt applications. My
                                                application spends
                                                constant time for each
                                                start, even if I closed
                                                it a second ago. </div>
                                              <div><br>
                                              </div>
                                              <div>Is there any way to
                                                optimize warm start of
                                                Qt application? </div>
                                              <div>Any hints are highly
                                                appreciated.</div>
                                              <div><br>
                                              </div>
                                              <div>Thanks,</div>
                                              <div>Sergey</div>
                                            </div>
                                            <br>
                                          </div>
                                        </div>
_______________________________________________<br>
                                        Android-development mailing list<br>
                                        <a moz-do-not-send="true"
                                          href="mailto:Android-development@qt-project.org"
                                          target="_blank">Android-development@qt-project.org</a><br>
                                        <a moz-do-not-send="true"
                                          href="http://lists.qt-project.org/mailman/listinfo/android-development"
                                          rel="noreferrer"
                                          target="_blank">http://lists.qt-project.org/mailman/listinfo/android-development</a><br>
                                        <br>
                                      </blockquote>
                                    </div>
                                    <span><font color="#888888"><br>
                                        <br clear="all">
                                        <div><br>
                                        </div>
                                        -- <br>
                                        <div
                                          data-smartmail="gmail_signature">
                                          <div dir="ltr">Xavier</div>
                                        </div>
                                      </font></span></div>
                                </blockquote>
                              </div>
                              <br>
                            </div>
                          </div>
                        </div>
                      </blockquote>
                    </div>
                    <br>
                    <br clear="all">
                    <div><br>
                    </div>
                  </div>
                </div>
                <span class="HOEnZb"><font color="#888888">-- <br>
                    <div data-smartmail="gmail_signature">
                      <div dir="ltr">Xavier</div>
                    </div>
                  </font></span></div>
            </blockquote>
          </div>
          <br>
        </div>
        <br>
        <fieldset class="mimeAttachmentHeader"></fieldset>
        <br>
        <pre wrap="">_______________________________________________
Android-development mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Android-development@qt-project.org">Android-development@qt-project.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.qt-project.org/mailman/listinfo/android-development">http://lists.qt-project.org/mailman/listinfo/android-development</a>
</pre>
      </blockquote>
      <p><br>
      </p>
      <br>
      <div class="moz-signature">-- <br>
        <p style="margin-bottom: 0cm"> <font ,="" color="#808080"
            face="Verdana, sans-serif"> <font size="4"> ekke </font><font
              size="1"><br>
            </font> </font> </p>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Android-development mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Android-development@qt-project.org">Android-development@qt-project.org</a>
<a class="moz-txt-link-freetext" href="http://lists.qt-project.org/mailman/listinfo/android-development">http://lists.qt-project.org/mailman/listinfo/android-development</a>
</pre>
    </blockquote>
    <p><br>
    </p>
    <br>
  </body>
</html>