Kerry Emerson
Posts: 0
Joined: Tue Feb 04, 2014 1:21 am

How do I store variables that remain after App is closed, phone is restarted etc?

I am creating an app that uses a username and password combination to check an API for access to a website. Once the login check happens, I would like to store an ID and hash on the device so that next time I run the app, users do not need to re-enter their credentials. Is this possible? Do variables in local storage remain when an app is closed, or are they wiped?

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

How do I store variables that remain after App is closed, phone is restarted etc?

Local storage is standard browser storage and API. Data you save will persist between navigation as well as closing/opening the browser.
https://developer.mozilla.org/en-US/d...
It will get deleted if you clear the storage or over write a key/value.

You could also use SQLite database.
http://docs.appery.io/tutorials/build...

Return to “Issues”