Best code examples for WebView addJavascriptInterface method (android.webkit.WebView.addJavascriptInterface)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for WebView addJavascriptInterface method.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

WebView addJavascriptInterface examples from Open Source projects
This code example shows how to use the following methods: addJavascriptInterface
123:	gap = new PhoneGap(this, appView); 
124:	geo = new GeoBroker(appView, this); 
125:	accel = new AccelListener(this, appView); 
126:	launcher = new CameraLauncher(appView, this); 
127:	mContacts = new ContactManager(this, appView); 
128:	fs = new FileUtils(appView); 
129:	netMan = new NetworkManager(this, appView); 
130:	mCompass = new CompassListener(this, appView); 
-
133:	appView.addJavascriptInterface(gap, "DroidGap"); 
134:	appView.addJavascriptInterface(geo, "Geo"); 
135:	appView.addJavascriptInterface(accel, "Accel"); 
136:	appView.addJavascriptInterface(launcher, "GapCam"); 
137:	appView.addJavascriptInterface(mContacts, "ContactHook"); 
138:	appView.addJavascriptInterface(fs, "FileUtil"); 
139:	appView.addJavascriptInterface(netMan, "NetworkManager"); 
140:	appView.addJavascriptInterface(mCompass, "CompassHook"); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: addJavascriptInterface
101:	geo = new GeoBroker(appView, this); 
102:	accel = new AccelListener(this, appView); 
103:	launcher = new CameraLauncher(appView, this); 
104:	fs = new FileUtils(appView); 
-
107:	appView.addJavascriptInterface(gap, "DroidGap"); 
108:	appView.addJavascriptInterface(geo, "Geo"); 
109:	appView.addJavascriptInterface(accel, "Accel"); 
110:	appView.addJavascriptInterface(launcher, "GapCam"); 
111:	appView.addJavascriptInterface(fs, "FileUtil"); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: addJavascriptInterface, getSettings, loadUrl, setLayoutParams, setWebChromeClient
24:	mWebView = new WebView(this); 
-
26:	mWebView.setLayoutParams(new LinearLayout.LayoutParams( 
-
29:	mWebView.loadUrl("file:///android_asset/www/index2.html"); 
30:	mWebView.getSettings().setJavaScriptEnabled(true); 
31:	mWebView.addJavascriptInterface(new MyHybrid(), "MyHybrid"); 
32:	mWebView.setWebChromeClient(new WebChromeClient() { 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: addJavascriptInterface, getSettings, loadUrl, setScrollBarStyle, setWebChromeClient
28:	web = new WebView(this); 
29:	web.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); 
-
32:	web.getSettings().setJavaScriptEnabled(true); 
33:	web.getSettings().setAllowFileAccess(true); 
-
35:	web.addJavascriptInterface(javascriptInterface, "android"); 
36:	web.setWebChromeClient(new WebChromeClient()); 
37:	web.setWebViewClient(new GenericWebViewClient()); 
-
56:	web.loadUrl(url); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: addJavascriptInterface, clearCache, clearFormData, clearHistory, getSettings
33:	webView = new WebView(this); 
-
36:	webView.getSettings().setJavaScriptEnabled(true); 
37:	webView.getSettings().setDomStorageEnabled(true); 
38:	webView.getSettings().setGeolocationEnabled(true); 
39:	webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true); 
40:	webView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE); 
41:	webView.clearHistory(); 
42:	webView.clearCache(true); 
43:	webView.clearFormData(); 
-
49:	webView.addJavascriptInterface(this, "lectorSupport"); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: addJavascriptInterface
97:	gap = new PhoneGap(this, appView); 
98:	geo = new GeoBroker(appView, this); 
-
100:	launcher = new CameraLauncher(appView, this); 
-
102:	appView.addJavascriptInterface(gap, "DroidGap"); 
103:	appView.addJavascriptInterface(geo, "Geo"); 
104:	appView.addJavascriptInterface(accel, "Accel"); 
105:	appView.addJavascriptInterface(launcher, "GapCam"); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: addJavascriptInterface, getSettings, loadUrl
33:	WebSettings settings = slide.getSettings(); 
-
38:	slide.addJavascriptInterface(new JsObject(activity), "Android"); 
-
44:	slide.loadUrl(url); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getHeight, addJavascriptInterface, getContentHeight, getSettings, x 1
32:	log.d( "webView.getHeight {0}", webView.getHeight() ); 
33:	log.d( "webView.getContentHeight {0}", webView.getContentHeight() ); 
-
35:	WebSettings webSettings = webView.getSettings(); 
-
37:	webView.addJavascriptInterface( new JavaScriptInterface(), JS_BRIDGE ); 
38:	webView.loadUrl( JS_CONTENTSIZE ); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: addJavascriptInterface, getSettings, loadUrl, setBackgroundColor
44:	mWebView.loadUrl("file:///android_asset/search.html"); 
45:	WebSettings webSettings = mWebView.getSettings(); 
-
50:	mWebView.setBackgroundColor(Color.BLACK); 
51:	mWebView.addJavascriptInterface(jsInterface, "gb"); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: addJavascriptInterface, getSettings, setWebViewClient
74:	this.view.getSettings().setJavaScriptEnabled(true); 
75:	this.view.addJavascriptInterface(this.new jsInterface(), "wmpjs"); 
76:	this.view.setWebViewClient(this); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: addJavascriptInterface, clearView, getSettings, loadUrl, setBackgroundColor
25:	WebView w = new WebView(context); 
26:	w.getSettings().setBuiltInZoomControls(useDefaultZoomControls); 
-
28:	w.setBackgroundColor(0x00000000); 
29:	w.getSettings().setJavaScriptEnabled(true); 
-
31:	w.setWebChromeClient(new WebChromeClient() { 
-
37:	w.setWebViewClient(new WebViewClient() { 
-
64:	w.addJavascriptInterface(new Object() { 
-
70:	w.clearView(); 
71:	w.loadUrl(getUrlToDisplay()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: addJavascriptInterface, getSettings, loadData, setWebViewClient
93:	webView.addJavascriptInterface(object, name); 
94:	webView.getSettings().setJavaScriptEnabled(true); 
95:	webView.setWebViewClient(mWebViewClient); 
96:	webView.loadData("<!DOCTYPE html><title></title>", "text/html", null); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: addJavascriptInterface, getSettings, loadUrl, setWebChromeClient, setWebViewClient
69:	webView = new WebView(activity); 
70:	webView.getSettings().setJavaScriptEnabled(true); 
71:	webView.setWebChromeClient(new WebChromeClient() {  // Purely for debugging. 
-
78:	webView.setWebViewClient(new WebViewClient() {  // Purely for debugging. 
-
87:	webView.addJavascriptInterface( 
-
89:	webView.loadUrl(gaeUrl); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setHorizontalScrollBarEnabled, setVerticalScrollBarEnabled, addJavascriptInterface, getSettings, loadUrl
121:	webView = new WebView(getContext()); 
122:	webView.setLayoutParams(FILL); 
123:	webView.setHorizontalScrollBarEnabled(false); 
124:	webView.setVerticalScrollBarEnabled(false); 
125:	webView.getSettings().setJavaScriptEnabled(true); 
126:	webView.getSettings().setSavePassword(false); 
127:	webView.getSettings().setSaveFormData(false); 
128:	webView.getSettings().setRenderPriority(HIGH); 
-
130:	webView.setWebChromeClient(new WebChromeClient() { 
-
137:	webView.setWebViewClient(new WebViewClient() { 
-
171:	webView.addJavascriptInterface(new HappyDroidJavascriptInterface(getContext(), this), "happyDroid"); 
-
174:	webView.loadUrl(uriToLoad); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: addJavascriptInterface, getSettings, setWebViewClient
19:	WebView webView = new WebView(activity); 
20:	settings = webView.getSettings(); 
-
26:	webView.addJavascriptInterface(client, "INTERFACE"); 
27:	webView.setWebViewClient(client); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: addJavascriptInterface, getSettings, loadUrl
21:	wv = new WebView(this); 
22:	wv.getSettings().setJavaScriptEnabled(true); 
-
25:	wv.addJavascriptInterface(new DemoJavaScriptInterface(), "demo"); 
-
27:	wv.loadUrl("file:///android_asset/jquerytest.html"); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: addJavascriptInterface, getSettings, loadDataWithBaseURL, setWebChromeClient
89:	mWebView 		= new WebView(context); 
-
94:	WebSettings webSettings = mWebView.getSettings(); 
-
100:	mWebView.setWebChromeClient(new ChannelAPIWebChromeClient()); 
101:	mWebView.addJavascriptInterface(mJsInterface, "channelAPI"); 
102:	mWebView.loadDataWithBaseURL(null, CHANNEL_API_JAVASCRIPT_START + gaeChannelApiSource + CHANNEL_API_JAVASCRIPT_END, "text/html", "utf-8", null); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: addJavascriptInterface
95:	webView.addJavascriptInterface(appBinding, "TiApp"); 
96:	webView.addJavascriptInterface(apiBinding, "TiAPI"); 
97:	webView.addJavascriptInterface(new TiReturn(), "_TiReturn"); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: addJavascriptInterface, getSettings, setWebChromeClient
27:	webView = new WebView(this); 
28:	webView.getSettings().setJavaScriptEnabled(true); 
29:	webView.addJavascriptInterface(this,"voteApp"); 
30:	webView.setWebChromeClient(new WebChromeClient(){ 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: addJavascriptInterface, getSettings, loadUrl, setScrollBarStyle
16:	mWebView=new WebView(this); 
-
18:	mWebView.getSettings().setAllowFileAccess(true); 
19:	mWebView.getSettings().setJavaScriptEnabled(true); 
20:	mWebView.addJavascriptInterface(new JavaScriptInterface(), "android"); 
21:	mWebView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); 
22:	mWebView.loadUrl("file:///android_asset/www/index.html"); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: addJavascriptInterface
90:	webView.addJavascriptInterface(mJsCallback, JS_INTERFACE_PKG); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: addJavascriptInterface, getSettings, loadUrl, setWebChromeClient
87:	view = new WebView(this); 
88:	WebSettings settings = view.getSettings(); 
-
100:	view.setWebChromeClient(new WebChromeClient() { @Override public void onProgressChanged(WebView view, int progress) { setProgress(progress * 1000); }}); 
101:	view.addJavascriptInterface(javaInterface, "java"); 
102:	view.loadUrl("file:///android_asset/index.html"); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setHorizontalScrollBarEnabled, setVerticalScrollBarEnabled, addJavascriptInterface, getSettings, loadUrl
80:	mWebView = new WebView(getContext()); 
81:	mWebView.setVerticalScrollBarEnabled(false); 
82:	mWebView.setHorizontalScrollBarEnabled(false); 
83:	mWebView.setWebViewClient(new WADialog.WAWebViewClient()); 
84:	mWebView.getSettings().setJavaScriptEnabled(true); 
85:	mWebView.addJavascriptInterface(new HTMLDumpInterface(), JS_INTERFACE); 
86:	mWebView.loadUrl(WA_URL); 
87:	mWebView.setLayoutParams(FILL); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: addJavascriptInterface, getSettings, loadUrl
29:	WebSettings settings = webview.getSettings(); 
-
31:	webview.loadUrl("file:///android_asset/linechart.html"); 
32:	webview.addJavascriptInterface(this, "NATIVE"); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: addJavascriptInterface, getSettings
26:	webView = new WebView(this); 
-
29:	webView.getSettings().setJavaScriptEnabled(true); 
-
36:	webView.addJavascriptInterface(this, "contactSupport"); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: addJavascriptInterface, getSettings
65:	view.getSettings().setJavaScriptEnabled(true); 
66:	view.addJavascriptInterface(htmlContentHolder, "HtmlContentHolder"); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: addJavascriptInterface, getSettings, loadUrl
109:	WebSettings webSettings = this.webView.getSettings(); 
-
116:	this.webView.addJavascriptInterface(new JavascriptBridge(), 
-
123:	this.webView.loadUrl("file:///android_asset/html/index.html"); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: addJavascriptInterface, getSettings
137:	WebSettings settings = webView.getSettings(); 
-
139:	webView.addJavascriptInterface(jInterface, "webdriver"); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: addJavascriptInterface
97:	webView.addJavascriptInterface(JSDInterface.getJSDInterface(), "JsHybuggerNI"); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: addJavascriptInterface
56:	webView.addJavascriptInterface(this, "android"); //so I can access this via android now? 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: requestFocus, setFocusable, setFocusableInTouchMode, setOnFocusChangeListener, addJavascriptInterface
61:	view.setOnFocusChangeListener(new View.OnFocusChangeListener() { 
-
70:	view.addJavascriptInterface(jsInterface, "webdriver"); 
-
80:	view.clearCache(true); 
81:	view.clearFormData(); 
82:	view.clearHistory(); 
83:	view.clearView(); 
-
85:	view.requestFocus(View.FOCUS_DOWN); 
86:	view.setFocusable(true); 
87:	view.setFocusableInTouchMode(true); 
-
90:	WebSettings settings = view.getSettings(); 
-
114:	view.enablePlatformNotifications(); 
115:	view.setNetworkAvailable(true); 
Full Snippet Info
3
CodeRank
Related WebView addJavascriptInterface Questions & Answers:
addJavascriptInterface Method Overview
Injects the supplied Java object into this WebView.
See Also