Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which minimum version of Android supports HTML5 Local storage?

Also, how to test if the browser in device supports local storage?

like image 769
Ashish Agarwal Avatar asked May 26 '12 14:05

Ashish Agarwal


People also ask

Does HTML5 support local storage?

With web storage, web applications can store data locally within the user's browser. Before HTML5, application data had to be stored in cookies, included in every server request. Web storage is more secure, and large amounts of data can be stored locally, without affecting website performance.

What is HTML5 local storage?

Local storage is part of the HTML5 Web Storage API and it allows you to store data in the browser. Unlike cookies, data stored using local storage isn't sent back to the server. All data stays on the client, and you can currently store from 2MB to 10MB.

Which can be used for Web Storage in HTML5?

In HTML5 there are two types of web storage API. localStorage: It is used to store data on the client-side. It has no expiration time, so the data in the LocalStorage exists always till the user manually deletes it.

Do mobile browsers support localStorage?

When using the local storage, you should consider the following: Validate that the local storage is available. This is available on browsers that support HTML5 and IE8+. Devices like IPhone, Android and BlackBerries support HTML5.


1 Answers

I would say that HTML5 storage is supported since API Level 7 (2.1) because the method that enable it in WebSettings Object says it here, but I think I'm using it on the Native browser since Android 2.0.

// Javascript Test
if (typeof window.localStorage == 'object')
{
    // localStorage is supported
}
else
{
    // localStorage is not supported
}

http://jsfiddle.net/kcckq/


Here is a blog post that tells us that is Android 2.1+


Here is another article that is saying it's Android 2.0+ and giving an example on how detecting if localStorage is supported.

like image 147
ChristopheCVB Avatar answered Oct 11 '22 23:10

ChristopheCVB