Skip to main content
Inspiring
October 30, 2013
Question

Problem Keeping Mobile App Running

  • October 30, 2013
  • 1 reply
  • 1002 views

Hi,

I'm noticing a problem keeping my mobile app running when it's brought back from the background. It seems after a period of time, iOS will terminate the running app even tho it's still shown as running in the task list. The app uses Flex, and so when the app goes into the background and say an hour later I click on the app's icon to bring it to the foreground, the same view is not restored, and the app behaves as if it is starting again for the first time. It does this even I can verify it is shown as running in the task list before i click on the app's icon. The same holds true for Android. I thought that the app is not terminated unless the OS terminates it, but the app is getting terminated somehow. Has someone seen this behavior before?

This topic has been closed for replies.

1 reply

Inspiring
October 30, 2013

Your app is being terminated by the OS while in the background. Just because it's still showing in the task list doesn't mean it's running. The ios task list is a list of recent used apps only. If the app runs light then the OS won't shut them, if they run heavy then the OS will shut them if needed. To give an example try turning off your iphone completely, power down. Then turn it back on, then there should be no app running what so ever. But you task list will still be full of all your recent apps and when tapped will still open for first time. My app is light weight I guess because the next day it reseumes from last view.

leejkAuthor
Inspiring
October 30, 2013

Ok that info helps. My app is pretty heavy, so it's getting terminated then most likely. So i guess to restore it back to it's last used state, I'd have to save it's state and restore it, correct?

Also, I'm using the File.cacheDirectory location to store downloaded data. If the app is terminated by the OS, is it possible that some of this data could have been discarded by the OS?

thx

Inspiring
October 30, 2013

Yes you will need to save data as to last state. Don't save in file.cacheDirectory though, that's for temp files that will be deleted by the OS. Save in file.applicationStorageDirectory.