Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is local storage for a Phonegap app on an Android device separate from the built in browser?

My question is essentially a follow up or clarification to this question.

I have an Android app built using Javascript and Adobe's Phonegap Build service, and I'm using "local storage" to store data on the device.

From that other question, I learned that data stored in local storage is essentially "permanent", in that it will stay on the device indefinitely, unless the user acts on it by manually clearing the cache for the app or deletes the app (and maybe other unusual circumstances that I'm willing to live with).

However, part of the accepted answer was confusing to me in that it started to blur the lines between talking about the phone's browser and talking about a Phonegap app.

What is unclear to me is if an app on Android using Phonegap uses the same cache as the phone's built in browser. Is Phonegap essentially an extension of the existing browser facility, or is it it's own separate stand-alone and self contained browser?

Critically, if a user clears the cache in their browser, will that impact an installed app based on Phonegap?

like image 526
Questioner Avatar asked Mar 03 '13 10:03

Questioner


People also ask

Does LocalStorage work on Android?

An AppSearch storage system which stores data locally in the app's storage space using a bundled version of the search native library. The search native library is an on-device searching library that allows apps to define androidx.

What are the storage options for PhoneGap applications?

SQLite is essentially the only way to persistently store unlimited data for PhoneGap applications, however other options I will cover in the rest of this post can also be made persistent and have unlimited data storage by using SQLite as a backend.

How do I find local storage on Android?

To view the storage data on Chrome Android, tap on the three dots in the corner of Chrome and go to Settings>Site Settings>Data Stored. You will be able to view the size of cache storage of all the sites.

What is local storage in mobile?

LocalStorage is a key/value datastore that's available on a user's browser. Like cookies, LocalStorage can only store string data for its keys and values. The datastore is only accessible to JavaScript within that domain. Note: Each domain has access to its LocalStorage datastore.


1 Answers

Since Phonegap uses Webiview to render your app : WebView and Phonegap.

And For security reason each app that uses WebView has its own cache and history. "No User or OS wants such data to be accessed by 3rd party applications". So in a nutshell, your app will keep its own history and data in its cache folder and will be deleted in one of the following cases:

  • User manually deleted them.
  • User used app setting screen and deleted them.
  • App uninstalled.

To read more about this. take look at WebView cache : Cookie and window management

like image 101
Mr.Me Avatar answered Oct 12 '22 09:10

Mr.Me