title: Full screen camera preview in portrait mode on Android 4.3
body: <p>I am using the Intel Inde library for media (specifically this example: <a href="https://github.com/INDExOS/media-for-mobile/blob/master/Android/samples/apps/src/com/intel/inde/mp/samples/CameraCapturerActivity.java" rel="nofollow">https://github.com/INDExOS/media-for-mobile/blob/master/Android/samples/apps/src/com/intel/inde/mp/samples/CameraCapturerActivity.java</a>) </p>
  
  <p>My goal is to set up a full screen preview in portrait mode and record videos in portrait mode.  Everything works great in landscape mode(full screen preview and recording).  However in portrait mode I can't stretch the preview to fill the screen vertically (even though I set the surface view to max size).  The largest size I get is a square image preview.  I have tried making the surface view larger then the screen, but still stuck with a square preview and recording.</p>
  
  <p>This is what my preview screen currently looks like:
  <a href="http://imgur.com/XUznvF1" rel="nofollow">http://imgur.com/XUznvF1</a></p>
  
  <p>Here is my code:</p>
  
  <pre><code>public void createCamera() 
  {
      Camera camera = Camera.open();
      Camera.Parameters parameters = camera.getParameters();
  
      List&lt;Camera.Size&gt; supportedResolutions = camera.getParameters().getSupportedPreviewSizes();
      parameters.setPreviewSize(supportedResolutions.get(0).width,   
      supportedResolutions.get(0).height);
      camera.setDisplayOrientation(90);  
      camera.setParameters(parameters);
  }
  
  public void createPreview() 
  {
       GLSurfaceView surfaceView = new GLSurfaceView(getActivity().getApplicationContext());
  
       //This code is used to get display size to set surface view size
       Display display = getActivity().getWindowManager().getDefaultDisplay();
       Point size = new Point();
       display.getSize(size);
       int width = size.x;
       int height = size.y;
  
       surfaceView.setLayoutParams(new FrameLayout.LayoutParams(width, height));
  
       //Used to test that the surfaceview does cover the whole screen
       //surfaceView.setBackgroundColor(Color.RED);
  
       ((RelativeLayout)view.findViewById(R.id.myview)).addView(surfaceView, 0);
  
       preview = capture.createPreview(surfaceView, camera);
       preview.start();           
   }
  </code></pre>