-2

/*[cache in webview] [1]http://tutorials.jenkov.com/android/android-web-apps-using-android-webview.html#caching-web-resources-in-html5-local-storage

I have used this link for my app. i am using webview in an app and i want to store the html , images,css into an app in cache folder. store webview data into aan app inside cache folder. please guide me on this. */

fresher
  • 1
  • 3
  • 1
    StackOverflow is not for "guiding" ... you are welcome to ask a real question(of course if it wasn't asked already) – Selvin Jan 16 '18 at 10:03
  • i am actually developing an app. and i am stuck at storing data into an app, i have used this code but didint work correctly. as i am fresher thats why said guide me – fresher Jan 16 '18 at 10:06
  • StackOverflow is [Q&A](https://stackoverflow.com/tour) site ... it is not make/fix (not)my code to work as I want for free service ... – Selvin Jan 16 '18 at 10:08

1 Answers1

1

Based on the link, you can use local storage, that can be done by using javascript.

From my knowledge, you can save and retrieve values using javascript.

// setting
localStorage.setItem("firstname", "First Name");

// Retrieve
document.getElementById("givenId").innerHTML = localStorage.getItem("firstname");

And you can check whether your app-web browser supports localstorage by using below code.

// Check iuf your browser supports local storage
if (typeof(Storage) !== "undefined") {
// supports
}

The code for setting from android webview is for enabling the web browser

webSettings.setDomStorageEnabled(true);
Jithu S
  • 76
  • 3
  • my website contains images also. in .jpg. should i have to store it in folder already or download when app opens for the first time.? – fresher Jan 16 '18 at 10:33
  • either save image url, or do something like this link. https://stackoverflow.com/questions/19183180/how-to-save-an-image-to-localstorage-and-display-it-on-the-next-page – Jithu S Jan 16 '18 at 10:53