Search code examples
androidioswebviewweb-sqlpolyfills

websql in android webview not created


I am using nparashuram's indexeddb polyfill for websql in an Android webview. when I first start my app, I create the database, 4 stores each with own indexes. I tested the polyfill in Chrome and Safari for iOS and everything works as expected, but in Android 4.3's webview and below, it seems that the init process does not work.

I need to manually delete the database and recreate it again, in order to be able to work with websql database. Did anyone else had this problem?

Is there any sustainable solution to this?


Solution

  • It seems that if I delay the init process of the database, I don't get any problems in Android webview. So far tested in Android 4.1.2 and Android 4.3. I did something like this:

    setTimeout(function(){
        app.initDB();
    },500);
    

    instead of simply app.initDB();