Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8321629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:05:06+00:00 2026-06-08T23:05:06+00:00

In Android’s WebView, what’s the difference between DomStorage , Database and AppCache ? I’m

  • 0

In Android’s WebView, what’s the difference between DomStorage, Database and AppCache?

I’m confused about these three settings. Now I need a instance of WebView that I can use localStorage in JavaScript.

Here is an example:

        if (localStorage['avatar_user_' + nick]) {
        obj.src = localStorage['avatar_user_' + nick];
    } else {
        var url = avatar_path + nick + '/avatar.jpg';
        new Oauth().img("jpeg", url,
            function(data) {
                if (data != '') {
                    obj.src = data;
                    localStorage['avatar_user_' + nick] = data;
                }
            }, function() {}
        );
    }

In the above code I really get the image from the web, and it will be loaded from the localStorage the next time I need it, but the storage only lasts as long as the app’s lifetime.

If I restart my app, then the image will be loaded from the web again.

I setup my WebView as follows:

    mWebSettings.setAppCacheEnabled(true);
    mWebSettings.setDomStorageEnabled(true);
    mWebSettings.setDatabaseEnabled(true);
    mWebSettings.setDatabasePath("file:///data/data/com.xxx/databases");

but I can see the files in file:///data/data/com.xxx/databases remain unchanged when I’m adding something into localStorage.

So my question is how to make my webpages store data and keep them after the app is closed?

And does it matters if I use multiple WebView in a app and point the DatabasePath to the same folder?

And if you can tell me the difference between DomStorage, Database and AppCache it would be so much better!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T23:05:08+00:00Added an answer on June 8, 2026 at 11:05 pm

    I’m not hundert percent sure, but DomStorage seems like an synonym for WebStorage. This is a technique to store data on client site as key=value pairs.
    http://diveintohtml5.info/storage.html

    Database means that the client-side SQL database will be enabled.
    http://www.html5rocks.com/en/tutorials/webdatabase/todo/

    And AppCache is a technique to make whole websites available for offline usage.
    http://appcachefacts.info/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

[Android Newbie alert] I need to capture the contents of a WebView in a
android noob... I have two tables, with a one to many relationship between country_tbl
Android programming. I have a json returning the date from a database as a
Android defines screen sizes as Normal Large XLarge etc. It automatically picks between static
Android Code Style Guide defines Android Code Style Rules. To conform to these rules
Android has a nice way of defining stretchable images called a nine-patch. See these
android.database.sqlite.SQLiteConstraintException: error code 19: constraint failed error in my application and not sure why.
Android’s Notepad tutorial Notepadv3 opens its database but never explicitly closes it. To make
Android supports three image formats with this rating: PNG (preferred), JPG (acceptable) and GIF
Android allows content of a URL to be displayed within an application using WebView

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.