title: android + ZXing barcode scanning library - custom size & orientation
body: <p>i've succeeded using the ZXing barcode scanning library , but only on landscape mode.</p>
  
  <p>i've also succeeded setting the camera preview to be on portrait mode AND show it correctly (without stretching) , but now the barcode doesn't work at all . 
  here're the changes i've made to "setDesiredCameraParameters" on "CameraConfigurationManager.java" in order to show the camera correctly :</p>
  
  <pre><code>void setDesiredCameraParameters(Camera camera)
  {
      Camera.Parameters parameters = camera.getParameters();
      Log.d(TAG, "Setting preview size: " + cameraResolution);
      setFlash(parameters);
      setZoom(parameters);
      camera.setDisplayOrientation(90);
      parameters.set("rotation", 90);
      parameters.setPreviewSize(cameraResolution.y, cameraResolution.x);
      camera.setParameters(parameters);
  }
  </code></pre>
  
  <p>i've tried some solutions mentioned on other places , but either they don't work , or they work but cannot show the camera preview correctly .
  examples:
  <a href="https://stackoverflow.com/questions/8007194/how-to-use-zxing-in-portrait-mode">How to use Zxing in portrait mode?</a>
  <a href="http://code.google.com/p/zxing/issues/detail?id=178#c46" rel="nofollow noreferrer">http://code.google.com/p/zxing/issues/detail?id=178#c46</a>
  <a href="https://github.com/pplante/zxing-android/issues" rel="nofollow noreferrer">https://github.com/pplante/zxing-android/issues</a></p>
  
  <p>when i'm finished with that , i also need to customize the location&amp;size of the rectangle to the scanning . i know that i need to change "setManualFramingRect" on "CameraManager.java" , but i'm not sure if i do it correctly . here's the code for that:</p>
  
  <pre><code>public void setManualFramingRect(Rect rect)
  {
      if (initialized)
      {
          Point screenResolution = configManager.getScreenResolution();
          if (rect.right &gt;= screenResolution.x)
              rect.right = screenResolution.x - 1;
          if (rect.left &lt; 0)
              rect.left = 0;
          if (rect.bottom &gt;= screenResolution.y)
              rect.bottom = screenResolution.y - 1;
          if (rect.top &lt; 0)
              rect.top = 0;
          framingRect = rect;
          Log.d(TAG, "Calculated manual framing rect: " + framingRect);
          framingRectInPreview = null;
      }
      else
          _requestedFramingRect = new Rect(rect);
  }
  </code></pre>
  
  <p>of course ,i've changed "openDriver" to call :</p>
  
  <pre><code>if (_requestedFramingRect != null)
      setManualFramingRect(_requestedFramingRect);
  </code></pre>
  
  <p>please help me.</p>
  
  <hr>
  
  <p>EDIT: now i've found out that it doesn't work on some devices . it crashes on the beginning , and if you debug , you can see that even the preview doesn't work well.</p>