Running a Corona SDK App in the backround

Hello,

   I am currently trying to get my app to run in the background (mainly for it’s GPS functionality). I have heard that this “is” and “is not” possible from different sources. I have read that making a native app is the way to go, but I am simply not sure how that works alongside using Corona SDK as well. Please enlighten me anyone who may know something about this. I want to use Corona SDK, and I want the app to run in the background. Is that possible at all?

Let me try to explain.

Corona SDK’s implementation of Lua expects the app to be in the foreground because there has to be a UI there.  In other words if your app tried to update a value on the screen, it won’t work because the app has to be in the foreground.  You cannot use Corona SDK for backgrounded apps.   However, there are two exceptions:

1.  For iOS only you could play background audio since that doesn’t need the UI present to work.  It’s the only backgrounded mode that works.  Android does not support this.

  1. If you were a Corona Enterprise subscriber, you could do your GPS work in native land and just store values until the UI came back to the foreground and then update as needed. 

Rob

Thank you for your response Rob. Would the best way to do this include me adding the Objective-C code in my main.lua file or incorporate it in a custom library that I make?

You can’t put objective C directly into your main.lua.  Corona SDK doesn’t have any way to include Objective C.   For that there are two options that we offer:

Corona Enterpirse – This platform lets you completely mix Corona SDK/Lua and both Objective C, C++ for iOS and C++ and Java for Android.  For iOS you would actually build your app using Xcode just like any native app and it incorporates Lua in it.  The UI of your app is still coming from Corona SDK.

Corona Cards – This is a different angle on mixing native development and Corona/Lua.  In this case, your Corona App is just a view inside of anotherwise native app.

Rob

Let me try to explain.

Corona SDK’s implementation of Lua expects the app to be in the foreground because there has to be a UI there.  In other words if your app tried to update a value on the screen, it won’t work because the app has to be in the foreground.  You cannot use Corona SDK for backgrounded apps.   However, there are two exceptions:

1.  For iOS only you could play background audio since that doesn’t need the UI present to work.  It’s the only backgrounded mode that works.  Android does not support this.

  1. If you were a Corona Enterprise subscriber, you could do your GPS work in native land and just store values until the UI came back to the foreground and then update as needed. 

Rob

Thank you for your response Rob. Would the best way to do this include me adding the Objective-C code in my main.lua file or incorporate it in a custom library that I make?

You can’t put objective C directly into your main.lua.  Corona SDK doesn’t have any way to include Objective C.   For that there are two options that we offer:

Corona Enterpirse – This platform lets you completely mix Corona SDK/Lua and both Objective C, C++ for iOS and C++ and Java for Android.  For iOS you would actually build your app using Xcode just like any native app and it incorporates Lua in it.  The UI of your app is still coming from Corona SDK.

Corona Cards – This is a different angle on mixing native development and Corona/Lua.  In this case, your Corona App is just a view inside of anotherwise native app.

Rob

please go to

http://feedback.coronalabs.com/forums/188732-corona-sdk-feature-requests-feedback/suggestions/7110076-add-powermanager-class

and vote for " add poewrManage class" dude.

we need it

please go to

http://feedback.coronalabs.com/forums/188732-corona-sdk-feature-requests-feedback/suggestions/7110076-add-powermanager-class

and vote for " add poewrManage class" dude.

we need it