Question

I am making a website in HTML5/CSS3 and would be using features like a Local Storage and session Storage

later on I also need to develop an Android app (NOT mobile website) for the same website using PhoneGap.

so, Is it possible to still use the session storage and local storage features of HTML5 in the native android App?

Was it helpful?

Solution

Local Storage can be used in PhoneGap. Session Storage is also supported.

For using Local Storage,go through the documentation:

http://docs.phonegap.com/en/2.0.0/cordova_storage_storage.md.html#localStorage

window.sessionStorage provides the same interface, but is cleared between app launches.

OTHER TIPS

You can use localStorage and sessionStorage in your PhoneGap app no problem. Naturally the sessionStorage data will only exist for the length of the session in question and will be destroyed when the app is exiting.

The localStorage data will remain of course but will be tied to the app only. You will not be able to access the same localStorage data between the website and the PhoneGap app. I'm sure you know this but am just pointing it out.

Just done this in Uni and (assuming) you're on about PHP/MySQL sessions?

The answer is unfortunately not, you'd have to use XML in order to be able to replicate sort of thing.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top