title: Android Camera Set Resolution
body: <p>I have built a custom Camera App and I am trying to change the resoloution of the image that is took. I have read around that this could depend on the phone or version of Android?</p>
  
  <p>I know they are set using the <code>setParameters</code> but just dont know how to set the actuall resoloution to work on all phones. I am wanting it to be kind of small as my app force closes otherwise. When I use a test picture at 640x348 this works so around that size/resoloution would be perfect.</p>
  
  <p>It may be easier to use <code>setPictureSize</code>?</p>
  
  <pre><code>public void surfaceCreated(SurfaceHolder holder) {
      // TODO Auto-generated method stub
      camera = Camera.open();
      try {
             Camera.Parameters parameters = camera.getParameters();
             if (this.getResources().getConfiguration().orientation != Configuration.ORIENTATION_LANDSCAPE) {
                parameters.set("orientation", "portrait");
                camera.setDisplayOrientation(90);
                // Uncomment for Android 2.0 and above
                parameters.setRotation(90);
             } else {
                parameters.set("orientation", "landscape");
                camera.setDisplayOrientation(0);
                // Uncomment for Android 2.0 and above
                parameters.setRotation(0);
             }
            camera.setParameters(parameters);
            camera.setPreviewDisplay(holder);
        } catch (IOException exception) {
           camera.release();
         }
          camera.startPreview();
      }
  </code></pre>