How can I acces webview content on my Android? I have read this post : answer1
but it suggested to use embeded javascript which cause me @SuppressLint("JavascriptInterface")
warning so I have decided not to use this method. Can I anyhow acces the content of the body via WebViewClient()
? I also get the content via Json in body but I can not acces any entity to read it.
.setWebViewClient(new WebViewClient(){
@Override
public void onPageFinished(WebView view, String url) {
}
@Override
public void onLoadResource(WebView view, String url) {
if(url.equalsIgnoreCase(the_url)){
//here get the content
}
super.onLoadResource(view, url);
}
});
I want achieve something similar to
final HttpEntity httpEntity = httpResponse.getEntity();
is = httpEntity.getContent();
or just simply read the whole String between <body>...</body>
the explanation: I want to log in the user on my website, for security reason I need to load url with the formular, when the user is loged in as response I get both Json with some security token and it is echoed so it looks like this:<body>{"token":"abcd"}</body>
But I need that token, and I need that on every device, so I have to find a way how can I read it from JSON or from the webpage. please help me with that.
thanks