I have a simple Android app with WebView. WebView is installed to go to a site that uses the localStorage JavaScript function.
I already have my WebSettings suite installed that allows DomStorage:
webSettings.setJavaScriptEnabled(true);
ebSettings.setDomStorageEnabled(true);
String dbPath = this.getApplicationContext().getDir("database", MODE_PRIVATE).getPath();
webSettings.setDatabasePath(dbPath);
I need a way in which my Java code can read a variable stored using the localStorage mechanism, for example:
JavaScript does this:
var storage = window.localStorage;
storage.setItem("name", "Hello World!");
How can I find out the value of "name" from localStorage from Java code?
source
share