[Interest] Keeping app alive on iOS and Android

md at rpzdesign.com md at rpzdesign.com
Mon Aug 3 23:44:15 CEST 2015


Nuno:

You will have a challenge with this.

Mobile apps are made to go inactive and then are give ZERO warning when 
they are removed from memory.

So you have a design challenge knowing that you are only guaranteed 
about 10 seconds after the inactive window state change to tidy things 
up and prepare for shutdown.

You greatest challenge is IOS since it has strict rules about background 
stuff, but at least you would increase your chances of staying in memory 
longer by accessing the API telling the operating system to "try to keep 
me around", but it does not work that well.

For android, you would have to create a background service Intent, 
completely in java, outside of the C++ Native Activiy running in Qt, 
then you would have to pass your app data to this intent to somehow keep 
the data and work "up to date".  This might even mean that the Native 
Activity is not actually unloaded, but no promises on that.

My plan is to properly shut things down upon windows state INACTIVE and 
then test the memory to see if the operating system fully dumped the app 
during the time between INACTIVE and ACTIVE windows state.

If fully dumped, then you have to repeat the load up of your data and 
processing.

Maybe break down the loading of data into priorities so the user has a 
quicker time of starting to use your app.



On 8/3/2015 9:36 AM, Nuno Santos wrote:
> Hi,
>
> One of the main problems I have been having with Qt for mobile is keeping app alive when I switch to other apps.
>
> My app takes a considerable amount of time to load and if I switch app and return to it afterwards, it needs to load again.
>
> I want to understand if this is something I’m doing wrong or if it is a Qt limitation.
>
> Is anyone having a similar problem?
>
> Thanks in advance,
>
> Regards,
>
> Nuno
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>

-- 
No spell checkers were harmed during the creation of this message.



More information about the Interest mailing list