title: How to set the size and quality of a picture taken with the android camera?
body: <p>I wrote this code that takes a picture with the camera then converts it to a jpeg file and uploads it to Parse.com as a ParseFile.</p>
  
  <p>The problem is that the picture is really small (153 x 204 px) and really low quality.</p>
  
  <p>I need the picture to be at least 5 MP quality and to crop it to 300x300 px.</p>
  
  <p>Here is the code I use til now.</p>
  
  <pre><code> @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_add_picture);
  
          img = (ImageView) findViewById(R.id.imgV);
  
          Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
  
          startActivityForResult(cameraIntent, CAMERA_PIC_REQUEST);
  
      }
  
  
      @Override
      protected void onActivityResult(int requestCode, int resultCode, Intent data) {
          byte[] image_byte_array;
                ParseObject post_object = new ParseObject("Gallery");
              Bundle extras = data.getExtras();
              Bitmap image = (Bitmap) extras.get("data");
              ByteArrayOutputStream stream = new ByteArrayOutputStream();
              image.compress(Bitmap.CompressFormat.JPEG, 100, stream);
              image_byte_array = stream.toByteArray();
              ParseFile picture_file = new ParseFile("Picture.jpg", image_byte_array);
              picture_file.saveInBackground();
              post_object.put("photo", picture_file);
              post_object.saveInBackground();
          }
  </code></pre>
  
  <p>Thanks in advance.</p>