Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
621 views
in Technique[技术] by (71.8m points)

cordova - 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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...