user874353
user874353

Reputation: 111

Can android webview access the Android sqlite database content using JavaScript?

I have a SQLite DB(say, Employees is the DB name) cretaed by my android application. I also have a webview in my application. Is it possible i can access the DB Employees data inside the webview using the javascripts.

Please suggest me a sample where I can proceed to.

Upvotes: 0

Views: 5870

Answers (2)

onmyway133
onmyway133

Reputation: 48165

As far as I know, the only way is to use

public void addJavascriptInterface (Object object, String name)

The javascript code in the webview will rely on the Android native code to do the SQLite commands

Upvotes: 1

Dmitry Stropalov
Dmitry Stropalov

Reputation: 790

Take a look at WebSettings method setDatabasePath and this answer – android WebView HTML5 access database problem.

Upvotes: 0

Related Questions