0

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.

2 Answers 2

1

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

Sign up to request clarification or add additional context in comments.

Comments

0

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

2 Comments

I m able to create a DB inside a webview . My question is to access the Db which already exists as part of my Activity based sqlite DB created , How to access the same inside the webview using the javascripts. Any sample code if i could get would be of great help
@user874353: have you found a solution to this aspect. I'm in similar situation. My javascript code works with a different db in path, i would like it to work with the one from /data/data/databases/.. If you know, post a response: stackoverflow.com/questions/13014163/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.