[Android-development] Warm application start time

ekke ekke at ekkes-corner.org
Wed Jun 15 19:28:10 CEST 2016


compared performance of re-opening of native Android apps and Qt Android
apps:

Native Android apps open immediately - doesn't matter if minimized by
BACK, HOME or OVERVIEW Button.
Qt Android apps open immediately if minimized by HOME or OVERVIEW
Button, but if closed by BACK it took some time.
Seems Android caches some things and Qt Android are re-loading stuff.

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.

So if your app needs some time for first time opening, same time will be
needed if re-opening after exiting with BACK.
To avoid this, overwrite BACK Button Behavior from Keys.onBackPressed:
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.

Have no idea if you  can trigger the HOME Button if BackPressed

ekke

Am 15.06.16 um 09:16 schrieb ekke:
> Am 15.06.16 um 08:00 schrieb Лагнер, Сергей:
>> Indeed. I have checked it carefully. I call QApplication quit if my
>> StackView has the last Page. 
>> But what should I do to hide the app once user presses the back button?
> just noticed:
> if app becomes inactive because user uses Home or Overview Button,
> re-opening is very fast
> if user uses BACK button app is closed and re-opening took a long time
>
> you can overwrite BACK behavior:
> Keys.onBackPressed:{
> event.accepted=true
> //...
> }
>
> 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
>
> ekke
>>
>> 2016-06-15 1:57 GMT+06:00 Xavier Bigand <flamaros.xavier at gmail.com
>> <mailto:flamaros.xavier at gmail.com>>:
>>
>>     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.
>>
>>     With our app we don't have a such issue.
>>
>>     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.
>>
>>     Try to launch your app with a debugger, you'll see in the console
>>     if the process is killed when pressing the back button.
>>
>>     2016-06-14 21:31 GMT+02:00 Лагнер, Сергей <developer at lagner.ru>:
>>
>>         Thank you for advice
>>
>>         We are already doing our best to optimize QML loading time.
>>         We use Loaders from QML side 
>>         and lazy loading for models from C++ side. But the
>>         application still too heavy. 
>>         It takes 6 sec approximately to launch on Nexus 5. 
>>
>>         Therefore we are looking for other ways to improve our app. 
>>
>>         Now I'm care about warm start. 
>>
>>         Lets consider the following scenario:
>>         - I launch the app. It takes 6 sec.
>>         - Press back and see a home screen
>>         - Launch the app again in a second. And again it takes 6 sec.  
>>
>>         That is mean that all resources were freed and second start
>>         was completely from scratch. 
>>         I wonder if I could speed up the second(warm) start from java
>>         side. 
>>         For example, is it possible so save preloaded native
>>         libraries until the OS has the real lack of memory?
>>
>>         2016-06-14 21:56 GMT+06:00 Xavier Bigand
>>         <flamaros.xavier at gmail.com>:
>>
>>             Hi,
>>
>>             If you are using QML you may have to use Loaders to avoid
>>             loading of GUI parts that are not displayed directly.
>>             You can also take a look to the QtQuick compiler to
>>             improve qml loading.
>>             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.
>>
>>             2016-06-14 16:33 GMT+02:00 Лагнер, Сергей
>>             <developer at lagner.ru>:
>>
>>                 Hi all.
>>
>>                 I'm trying to optimize start time of my android
>>                 application. For now I'm interested in warm start time 
>>                 when the user presses back and quickly returns to the
>>                 app. If we consider java application the 
>>                 warm start is faster, it seems like android caches
>>                 something or so.
>>                 But it does not work for Qt applications. My
>>                 application spends constant time for each start, even
>>                 if I closed it a second ago. 
>>
>>                 Is there any way to optimize warm start of Qt
>>                 application? 
>>                 Any hints are highly appreciated.
>>
>>                 Thanks,
>>                 Sergey
>>
>>                 _______________________________________________
>>                 Android-development mailing list
>>                 Android-development at qt-project.org
>>                 <mailto:Android-development at qt-project.org>
>>                 http://lists.qt-project.org/mailman/listinfo/android-development
>>
>>
>>
>>
>>             -- 
>>             Xavier
>>
>>
>>
>>
>>
>>     -- 
>>     Xavier
>>
>>
>>
>>
>> _______________________________________________
>> Android-development mailing list
>> Android-development at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/android-development
>
>
>
> -- 
>
> ekke
>
>
>
> _______________________________________________
> Android-development mailing list
> Android-development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/android-development



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/android-development/attachments/20160615/8967239d/attachment.html>


More information about the Android-development mailing list