Sharing database between android native application and html5
<p>I'm writing a demo application to see if it is possible to share a database between native android and a web view. For this i added a webview and a button to my activity. On click of button i create a database  in /data/data/com.demo/databases/testdb. I can see this database on sqlite3 prompt. Then i wrote a html page which has following script tag in head section</p>

<pre><code>&lt;script type="text/javascript"&gt;
        if (window.openDatabase){
            db = window.openDatabase("testdb", "1", "test database", 1024*1024);
            alert("Database " + db);
            if(db){
                db.transaction(function(tx) 
                  {    
                    tx.executeSql('SELECT * FROM KeyValues', 
                      [], 
                      function (tx, rs) { displayMyResult(rs); }, 
                      function (tx, err) { displayMyError(err); } );
                  });
            }
        }else{
            alert("Database is not supported");
        }

        function displayMyResult(rs){
            alert("In display method");
            for(var i=0; i &lt; rs.rows.length; i++) {
                r = rs.rows.item(i);
                alert('id = ' + r['id'] + ', Key: ' + r['key_name'] + ', Value: ' +  r['key_value']);
            }
        }

        function displayMyError(err){
            alert(err.message);
        }
    &lt;/script&gt;
</code></pre>

<p>Issue is i'm always getting the database object db as null. May be this is not even possible. or am i missing something.</p>

<p>Any help is appreciated. </p>

<p>Edit : Bottom line : is it possible to access the database created by native android API in webview?</p>
