Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6758727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:50:10+00:00 2026-05-26T13:50:10+00:00

I have created a webapp that can be saved to the Home Screen on

  • 0

I have created a webapp that can be saved to the “Home Screen” on the iPhone. The app uses a canvas and is fairly interactive with changing state.

Whenever the app is minimised and re-opened it resets back to the initial state. The same (as expected) occurs when closing the app and reloading it.

  1. How can I prevent the app from being reloaded when it is merely minimised?

  2. What is the best way to persist state data so that when the app is
    closed and re-opened it continues seamlessly?

  3. What events would I need to use to ensure that state data is not lost?

If possible a cross platform solution would be preferred iPhone + Android…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T13:50:11+00:00Added an answer on May 26, 2026 at 1:50 pm

    TL;DR
    You’ll need to design your application to use local storage or cookies or some other mechanism with which you can preserve state. It will need to look at this local storage and rebuilt it’s interface every time it is launched. Using local storage or webdb (depreciated but supported), you’ll need to save every state change and make sure you reload them when your page loads in the browser.

    1. Define minimized? Running in the background?

      Your webapp, regardless of it’s status on the homescreen, is merely another page loaded into the browser. Due to a) the lack of memory on the device and b) how multitasking works, applications can be asked by the operating system to free up memory or even to terminate themselves at anytime.

      This is why when you’re building an iOS app you have:

      - (void)applicationWillTerminate:(UIApplication *)application

      This method allows you, as the developer, to specify a behavior to use (such as saving user data) before your application terminates when it receives the terminate signal from the OS. This is also why the iOS developer guides ask you to retain state and always make sure that your state is restored when an app is brought to the foreground. (Users may not know an app has terminated as it still will appear in the “running applications” list when you double-click the home).

      Now I understand you’re talking about a web app, but this is important. Web pages, and I’m sure yours as well, take up some memory in the phone — you’ve got the DOM, all the resources, information about the state as to where the page is and what widgets are set to what. You say your app is fairly interactive using the canvas and stuff — I’m sure it takes up a lot of memory.

      So when you put Safari in the background, Safari is most likely trashing your in-memory cache.

    2. Safari has access to both local storage and cookie data. iOS5 also has access to WebSQL (but no IndexedDB which is sad because WebSQL is depreciated). Choose your poison.

    3. You’ll need to always save state. Since you don’t have access to the UIApplicationDelegate methods via JS, every time the user does something, you’ll need to save that state change. And every time your page is reloaded, it needs to check for a persistant state and reload from the storage option which you’ve chosen.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some test code (as a part of a webapp) that uses urllib2
I have created a webapp using maven2 archetype in netbeans 6.7. when I do
I have a web app where people can create custom content on the web
I have created a PHP-script to update a web server that is live inside
I have created a UserControl that has a ListView in it. The ListView is
I have created a few small flash widgets that stream .mp3 audio from an
i have created a workflow activity that do give the item creater of a
I created an iphone app, and i'm currently in development of a web app
I have a webapp that I'm building, and have just started with SQLite. I
I have an extremely odd problem in my JUnit tests that I just can't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.