Running a Corona SDK App in the backround

Started by
joshuacalebbryan
Aug 02 2014 06:18 AM

This topic has been archived. This means that you cannot reply to this topic.

[/TOPIC CONTROLS]

[modOptionsDropdown]

[/modOptionsDropdown]

[reputationFilter]

[TOPIC: post.html]

#1

joshuacalebbryan

[GLOBAL: userInfoPane.html]

joshuacalebbryan

Observer

25 posts

Corona SDK

02 August 2014 - 06:18 AM

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?

Rob Miracle

[GLOBAL: userInfoPane.html]

Rob Miracle

Moderator

25,376 posts

Enterprise

02 August 2014 - 10:04 AM

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.

2. 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 Miracle

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.