I want to access a webapp as a android app, for this what I have done is simply calling url of that webapp by using webview. Webapp contains one js variable, I want to access that variable into androids MainActivity, how can I access and assign value to js variable which is in different webapp by using android MainActivity. Following is my code snippet for MainActivity,
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mWebview = new WebView(this);
mWebview.getSettings().setJavaScriptEnabled(true);
mWebview.getSettings().setDatabaseEnabled(true);
mWebview.getSettings().setLoadWithOverviewMode(true);
mWebview.setScrollBarStyle(WebView.SCROLLBARS_INSIDE_OVERLAY);
mWebview.setScrollbarFadingEnabled(false);
mWebview.loadUrl("http://www.mywebapp.com");
setContentView(mWebview);
}
My main question is how to access and assign a value to js variable through androids MainActivity which is in different app/html?