Code example for WebView: Displaying web pages

Methods: loadUrlsetInitialScale, getZoomControls

0
        DisplayMetrics metrics = new DisplayMetrics();
        getWindowManager().getDefaultDisplay().getMetrics(metrics);
        //calculate display scale from screen size 
        double screenW = metrics.widthPixels;
        double scale = (screenW / 800) * 100; //width of image
        myWebView.setInitialScale((int) scale); //it will fit on width of the screen
	 
	 
	    FrameLayout mContentView = (FrameLayout) getWindow().
	    getDecorView().findViewById(android.R.id.content);
	    final View zoom = this.myWebView.getZoomControls();
	    mContentView.addView(zoom, ZOOM_PARAMS);
	    zoom.setVisibility(View.GONE);
	 
	    this.myWebView.loadUrl("file:///android_asset/bluechip.gif");
	    //Toast.makeText(getApplicationContext(), "Second Floor", Toast.LENGTH_LONG).show(); 
	} 
	 
	private int getScale() 
	{      
		Display display = ((WindowManager)getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();