Code example for WebView: Displaying web pages

Methods: getSettingsloadUrlsetWebChromeClientsetWebViewClient, setDownloadListener

0
			    } 
		    } 
	    } 
 
	    mWebView = (WebView) findViewById(R.id.webview);
	    mWebView.getSettings().setJavaScriptEnabled(true);
 
	    // Nothing needs to be changed in this file, all changes in build.prop now 
	    // Add this line to your build.prop ro.ota2.url=[Everything after ROMID= in your OTA admin] 
	    // Example from my build.prop ro.ota2.url=47&ID=44950871 
        String url = "http://www.jdvhosting.com/OTA2/ota.php?BuildDate=" + BuildDate + "&ROMID=" + exec("getprop ro.ota2.url");
        mWebView.loadUrl(url);
	    mWebView.setWebViewClient(new OTAWebViewClient() {
	    	@Override 
		    public void onPageFinished(WebView view, String url) {
		    super.onPageFinished(view, url);
		    } 
		    }); 
	    mWebView.setDownloadListener(new DownloadListener() {
	        public void onDownloadStart(String url, String userAgent,
	                String contentDisposition, String mimetype,
	                long contentLength) {
	            Intent intent = new Intent(Intent.ACTION_VIEW);
	            intent.setData(Uri.parse(url));
	            startActivity(intent);
 
	        } 
	    }); 
 
	    mWebView.setWebChromeClient(new WebChromeClient() {
	        public void onProgressChanged(WebView view, int progress) {
	            progressDialog.show();
	            progressDialog.setProgress(0);
	            activity.setProgress(progress * 1000);