title: Stretching camera preview to full screen in android
body: <p>I am using this <a href="https://github.com/commonsguy/cw-advandroid/tree/master/Camera/Preview/" rel="nofollow">camera preview</a> application for my Android app.</p>
  
  <p>I want the camera preview over the full screen.Hence I used the example from Android APIs to try setting the preview to full screen. This is how I am trying to do it:</p>
  
  <pre><code>if (!cameraConfigured) {
      Camera.Parameters parameters=camera.getParameters();
      Camera.Size size = getOptimalPreviewSize(mSupportedPreviewSizes, width, height);
      if (size != null) {
          parameters.setPreviewSize(size.width, size.height);
  
        camera.setParameters(parameters);
        cameraConfigured=true;
      }
  </code></pre>
  
  <p>I am using relative layout as my layout. My layout settings are follows:</p>
  
  <pre><code>&lt;android.view.SurfaceView xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@+id/preview"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  &gt;
  </code></pre>
  
  <p>I am still not able to preview my camera over the entire screen. I would like to know how to preview over the entire screen.</p>