suspendStack and resumeStack under Android

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

suspendStack and resumeStack under Android

Post by Mag » Mon May 20, 2013 1:48 am

Hi all,

I'm working on an app for Android that randomly play some effects sounds, all woks well but when you use the physical Home button in the device to leave the app (instead of the Return button), the app continues to play sounds. So I wonder if there is a way to know if there is a way to know when the app is not in foreground under Android OS.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: suspendStack and resumeStack under Android

Post by Simon » Mon May 20, 2013 4:47 am

Hi Mag,
I've looked everywhere for this and I don't think it can be done currently.
I've tried all the suspend/close/focus etc.

Yeah, I made a pong game that just kept happily playing the sndfx after it was closed.

If you do find out how, please post here.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Re: suspendStack and resumeStack under Android

Post by BvG » Mon May 20, 2013 10:40 am

A long time ago I was taught that LC apps quit when you put them into the "background" on mobile. I don't know if that's still true, but maybe try the shutdownRequest and/or startup messages?

Disclaimer: haven't ever tested if that information was correct, and they might have changed/improved it since then.
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: suspendStack and resumeStack under Android

Post by Simon » Mon May 20, 2013 11:06 am

I found that they only quit when the memory was required.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: suspendStack and resumeStack under Android

Post by Mag » Mon May 20, 2013 1:27 pm

I'm thinking that maybe we could have a workaround by try to catch the "back" and "home" (if possible) hardware buttons to learn when the app exit from foreground but this I think will open a can of worms :)

jun
Posts: 10
Joined: Mon May 27, 2013 7:44 am
Contact:

Re: suspendStack and resumeStack under Android

Post by jun » Thu Aug 22, 2013 5:09 am

Hello,

I have the same problem and I was thinking I should comment it here. Did somebody has solution for this one? And how did you do it? :(

William Jamieson
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 212
Joined: Fri Feb 01, 2013 1:31 am
Contact:

Re: suspendStack and resumeStack under Android

Post by William Jamieson » Fri Aug 23, 2013 5:09 am

Same, really curious to find out. I know that the back button sends a message that can be intercepted, but I dont know about the home key. It would be great though.

SteveTX
Posts: 170
Joined: Sun Jan 17, 2010 9:00 pm

Re: suspendStack and resumeStack under Android

Post by SteveTX » Mon Aug 26, 2013 7:28 pm

It is not possible currently because LiveCode devs have not implemented running services / processes. All livecode apps for mobile get suspended when they don't have focus. Want to change that? Say something here: http://forums.runrev.com/viewtopic.php?f=6&t=16321

Post Reply