Multitasking

What’s the best way to do multitasking with Corona?

I found the following resource but was wondering if Corona has native functionality for multitasking that I could use?

http://techority.com/2011/04/02/how-to-save-and-load-data-in-your-app/

Thanks,

Kevin [import]uid: 87324 topic_id: 15874 reply_id: 315874[/import]

Hey Kevin,

Actually saving and loading data isn’t for the purposes of multitasking - it’s for saving and loading data when the app quits.

You can easily have multitasking work with your app by putting this line in your build.settings plist;

[lua]UIApplicationExitsOnSuspend = false[/lua]

Peach :slight_smile: [import]uid: 52491 topic_id: 15874 reply_id: 58697[/import]

Does this allow having music playing in the background from itunes for example? if not, are you planning on adding this in a near future? [import]uid: 103182 topic_id: 15874 reply_id: 95149[/import]

Playing music from the app itself while it is suspended? No, this does not support that.

If that’s what you mean I would encourage you to make a post in Feature Request :slight_smile: [import]uid: 52491 topic_id: 15874 reply_id: 95189[/import]

No , not playing music from the app itself. =)
I mean, i don’t won’t the app to cut the music that i’m currently playing. No other apps that i’v installed are doing that except the ones made in Corona. Is this fixable? [import]uid: 103182 topic_id: 15874 reply_id: 95202[/import]

FYI - I`ve my app built with latest stable build and am able to get my musics of itunnes playing (at background - multitasking) and also run my Corona app without it "cut"or stop the music.

Cheers, [import]uid: 89165 topic_id: 15874 reply_id: 95328[/import]

Thats awesome!
Has something happened since the last stable build, or am i missing a line of code or something? [import]uid: 103182 topic_id: 15874 reply_id: 95329[/import]

@marcelo - honestly I`ve done “nothing” to get it working like this and so I think it would be like the “default” of CoronaSDK, no? :slight_smile:
Cheers,
Rodrigo. [import]uid: 89165 topic_id: 15874 reply_id: 95338[/import]

You are right. I just tested an empty app on my Iphone4 and it didn’t stop the music.
Now i just have to figure what might be causing the sound stop on my other app.
Thanks! [import]uid: 103182 topic_id: 15874 reply_id: 95501[/import]

It seems like the music stops at the moment i start loading sounds with audio.loadSound().
I switched the audio handling to using media.playEventSound instead, and now it works fine =)!
[import]uid: 103182 topic_id: 15874 reply_id: 95506[/import]

@marcelo - thanks for sharing the info!

By the way, you`ve switched for a “deprecated” audio API no?

So, I think the best way for us to get it “solved” without the needs to use the deprecated API is filling a bug , would you mind doind that?
Thanks anyway,
Rodrigo. [import]uid: 89165 topic_id: 15874 reply_id: 95600[/import]

I’m on it!
[edit] done. [edit] [import]uid: 103182 topic_id: 15874 reply_id: 95603[/import]

Thanks Marcelo! Great! :slight_smile:
[import]uid: 89165 topic_id: 15874 reply_id: 95606[/import]