[Interest] Keeping app alive on iOS and Android

Jason H jhihn at gmx.com
Mon Aug 3 21:55:51 CEST 2015


This is a problem even not in Qt. The idea that you can be suspended and closed and resumed is pervasive on mobile platforms. 

Android has the idea of a Bundle. If you've ever had an app that didn't fully restore it's state on Android (and I've encountered several), it's because the changes were not persisted in the bundle. I see this a lot with text entry fields - they assume the app won't be suspended but when the Activity is resumed, the text is blank.

You'll have to come up with your own analogy to the Bundle. Be it a JSON object, or database entries. You'll have to manage your own persistence to whatever degree you require it. This may involve storing the current screen and all other screens up to the one you are on. Android cheats and does this graphically, relying on it's bitmap to match what is (hopefully) restored by the app. Again, it's not a perfect world. 

Adding to complexity, you can be killed for a variety of reasons as well, not just memory.

> Sent: Monday, August 03, 2015 at 11:36 AM
> From: "Nuno Santos" <nunosantos at imaginando.pt>
> To: interest <interest at qt-project.org>
> Subject: [Interest] Keeping app alive on iOS and Android
>
> 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
>



More information about the Interest mailing list