GPS Tracker app to run in background

I am writing my first Corona app for Android only, which:

  • receives data from the GPS

  • Transmits this data over a TCP socket to an internet server.

I need the app to be able to run in the background, without interuptions, by having the User press a ‘Go to Background’ button.

How do I do this?

Thanks,  Bart

You cannot background Android apps with Corona. 

Good grief, why not?? Its just Linux!

This stuffs up my whole application.

Is there any way I can keep the app running when the device goes to sleep?

Else, is there a way to prevent the device going to sleep, but dim the display?

I am now grasping at straws…

Thanks,  Bart

The system.setIdleTimer() API call will prevent your app from sleeping:

http://docs.coronalabs.com/api/library/system/setIdleTimer.html

But understand the caveats with using it.  As for why, my understanding is that Lua isn’t background safe.  (that is running while backgrounded). 

You cannot background Android apps with Corona. 

Good grief, why not?? Its just Linux!

This stuffs up my whole application.

Is there any way I can keep the app running when the device goes to sleep?

Else, is there a way to prevent the device going to sleep, but dim the display?

I am now grasping at straws…

Thanks,  Bart

The system.setIdleTimer() API call will prevent your app from sleeping:

http://docs.coronalabs.com/api/library/system/setIdleTimer.html

But understand the caveats with using it.  As for why, my understanding is that Lua isn’t background safe.  (that is running while backgrounded). 

Hi Bart,

I m working in a similar App, have you found a solution? Thanks

Regards, Josep

No, I have dropped the project for the time being.

Unless Corona has beeen improved to be able to make background apps… I am not following it at the moment.

Bart

Hi Bart,

I m working in a similar App, have you found a solution? Thanks

Regards, Josep

No, I have dropped the project for the time being.

Unless Corona has beeen improved to be able to make background apps… I am not following it at the moment.

Bart

Does anyone know if it is still impossible (with the last release) to continue to perform a task when the display turns off? Otherwise it makes almost useless the support to GPS and maps that could be very interesting in many apps like navigators and GPS track recorders.

thanks

Mauro

The new release does not bring any new backgrounding facilities with it. 

Rob

Ok, thank you anyway for your reply.

Mauro

Does anyone know if it is still impossible (with the last release) to continue to perform a task when the display turns off? Otherwise it makes almost useless the support to GPS and maps that could be very interesting in many apps like navigators and GPS track recorders.

thanks

Mauro

The new release does not bring any new backgrounding facilities with it. 

Rob

Ok, thank you anyway for your reply.

Mauro

Hey, just checking in here! was wondering if corona supports background running apps now?

@Sonic,

No it does not. 

Also, for future askers, I think the answer will always be no.  I know this is a popular idea, but it is unlikely to change as its a fundamental part of the way Corona operates.

Having said that, if Corona does decide to support background operations, I’m sure they’ll post a big blog about it.  

This is not something they’d do and then not announce. 

Thanks! What language will let me run background apps? as im a fast learner i think i can learn a language decently in a couple months.