03-25-2011 05:06 PM
Does the background start page run in a different thread then the foreground application? I'm looking to using a "worker" of types to do some file IO work that is kind of involved from a performance perspective but workers don't support the API calls, so maybe the background start page is an option (assuming it does have API access)?
03-26-2011 11:18 AM
There is only ever one web page running at one time. Specifying a run on startup (background) page will have that page run when the app is installed or when the device reboots
If you have a different page specified when the app launches from the home screen, the old background page will be unloaded and the new page will be loaded when the user selects the icon from the home screen.
The old background page does not run while the new foreground page is loaded.
The intent of having a background page separate is if you wanted some light weight work to run in the background on start of the device as a different entry point than if the user clicks the home screen icon
Does that answer your question? or make it more confusing
03-26-2011 12:19 PM
That answers my question perfectly. I have some file clean up work to do after my app downloads content, but in the main app it locks up the UI, and is not 100% required but more for maintenance to keep the storage usage low.
Is there a way to start the background page when the user exit's the app or is only on startup? is there any connection between the background and the foreground where i can preload content to speed up the UI?
Last, what, if any, are the programming limitations of the background page?
My plan was to start playing around but your insight always saves me time so thank you!
03-26-2011 01:30 PM
03-26-2011 02:33 PM
That makes sense, and lines up with my existing process of repackaging text files which is recursive by nature since there are several txt files to go through. I'll give it a shot!
03-26-2011 03:07 PM
Related question... what happens when a user cut's off a script that is writing to a text file? Does it get corrupted or allowed to finish? What if the battery dies in the middle of a write? Since it's probably difficult to simulate that situation I was just curious so that I can have code to recover from such a possibility otherwise it could leave my app crippled.
03-26-2011 05:17 PM
Those are good questions.. I would have to talk to the team to find out what would happen in those situations.