Livecode Mobile App in Background

Mark Waddingham mark at livecode.com
Sat Aug 12 09:27:02 EDT 2017


One of things the engine doesn't give you notifications on suspend and resume - it is something on the todo list, however the last time we tried it turned out to be considerably harder than we thought (although that could be that we were overthinking things...).

In reality these kinds of notification are advisory at best, certainly under iOS they come with significant constraints which means that you have to be very careful what you do at those points.

Indeed, the 'brutal' truth is that if your app is suspended it means it is but a hairs breadth from being forcibly expunged - so the best thing to do is to ensure that at suitable points during user interaction you save the state you need to come back to that point. This means that even if your suspend handler (when we add that to the engine) does get terminated prematurely (which is a matter of wall clock time spent in it) that doesn't matter.

Indeed, working like that means that suspend and resume aren't really that relevant - the engine already turns off the things you need to when suspended and turns them back on when it resumes.

Putting it another way, save state as your app runs - don't wait for a suspend or quit notification as you may not have time in those to actually save everything you might need to. Saving state incrementally whilst in the foreground is a much more reliable approach.

Warmest Regards,

Mark.

Sent from my iPhone

> On 12 Aug 2017, at 03:49, J. Landman Gay via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> I think I remember that "wait" is a problem too.
> 
> Meanwhile I know of no solution for Android. The OS controls what runs in the background and when it gets wiped from RAM. You'll never know when that happens either. It's an issue that causes trouble.
> 
> If anyone knows of a solution before I talk about this in my presentation on Thursday, do tell.
> 
> --
> Jacqueline Landman Gay         |     jacque at hyperactivesw.com
> HyperActive Software           |     http://www.hyperactivesw.com
> 
> 
> 
>> On August 11, 2017 9:34:41 PM Ralph DiMola via use-livecode <use-livecode at lists.runrev.com> wrote:
>> 
>> There are a couple of hitches.. I believe that Mark said that timers going off while running in the background may not work or lock up the app. There are other issues but I have not had any problems. It's an option in v9 iOS standalone setting but it's a "use at your own risk" type of thing.
>> 
>> Ralph DiMola
>> IT Director
>> Evergreen Information Services
>> rdimola at evergreeninfo.net
>> 
>> 
>> -----Original Message-----
>> From: use-livecode [mailto:use-livecode-bounces at lists.runrev.com] On Behalf Of Dan Friedman via use-livecode
>> Sent: Friday, August 11, 2017 10:12 PM
>> To: use-livecode at lists.runrev.com
>> Cc: Dan Friedman
>> Subject: Re: Livecode Mobile App in Background
>> 
>> Ralph,
>> 
>> Thank you for the detailed reply!   I tried it and it seems to work great.   One question… if it’s that simple, why hasn’t LiveCode offered this as a feature?   Seems like it would take a few minutes to write this in?   Is there a catch to using this method?
>> 
>> -Dan
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
>> 
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the Use-livecode mailing list