How to keep Codea app running in the background? GPS Logger.

Trying to make a simple GPS logger app. Problem is, when the app ‘suspends’ by pressing the home button or when the iPhone timeouts and returns to the lock screen, then it stops updating.

Does anyone know of a way to keep updating variables in the background?

The program below just prints a series of numbers, but they stop updating when the app ‘suspends’

function setup()
print(“Hello World!”)
location.enable()
i=0
end

– This function gets called once every frame
function draw()
– This sets a dark background color
background(40, 40, 50)

text("Latitude: " .. location.latitude,WIDTH/2,HEIGHT-HEIGHT/20)
text("Longitude: " .. location.longitude, WIDTH/2, HEIGHT-HEIGHT/20-HEIGHT/20)
text("Elevation (meters): " .. location.altitude, WIDTH/2,HEIGHT-HEIGHT/20*3)


print(i)
i = i +1
-- This sets the line thickness
strokeWidth(5)

-- Do your drawing here

end

@MrScience101 As far as I know, there’s no way to keep a background program running.

Thank you Dave1707 for the quick response and for your continued support of the forms. I have learned a lot from you over the years.

@MrScience101 Thanks for the comment. I try to help whenever I can.