title: Android webview. Fitting HTML on screen without a scrollbar
body: <p>I was trying to learn  web view on Android. I have a few questions. </p>
  
  <ol>
  <li><p>I have a PHP page, which has 2-3 small paragraphs and an Image which
  is randomly generated. How can I make sure that the whole HTML page
  fits perfectly on the mobile device’s screen (so that scroll bar
  isn’t seen)?  if it’s not possible in some instances that how can I
  make the image smaller so that it fits perfectly on every device ? .</p></li>
  <li><p>Second question is suppose I have a link on that HTML page. I want
  that when I click this link (which belongs to a different domain) it
  open up in the default browser NOT the android Application. (How can
  this be done).</p>
  
  <p>package com.example.try2;</p>
  
  <pre><code>import android.os.Bundle;
  import android.app.Activity;
  import android.view.Menu;
  import android.view.Window;
  import android.view.WindowManager;
  import android.webkit.WebSettings;
  import android.webkit.WebView;
  
  public class MainActivity extends Activity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          //Full screen
          requestWindowFeature(Window.FEATURE_NO_TITLE); 
          this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); 
  
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          WebView myWebView = (WebView) findViewById(R.id.webview);
          myWebView.setVerticalScrollBarEnabled(false);
          myWebView.setHorizontalScrollBarEnabled(false);
          myWebView.getSettings().setLoadWithOverviewMode(true); 
          myWebView.getSettings().setUseWideViewPort(true);
          WebSettings webSettings = myWebView.getSettings();
          webSettings.setJavaScriptEnabled(true);
          myWebView.loadUrl("http://www.example.com/mobile/index.php");
  
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.activity_main, menu);
          return true;
      }
  
  }
  </code></pre></li>
  </ol>