I'm trying to save image taken from camera in my phone. It works but the quality of images is very bad. First, for the intent, this is my code :
intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(intent, CAMERA_REQUEST);
And for ativity result, I tried this :
public void onActivityResult(int requestCode, int resultCode, Intent data)
{
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == CAMERA_PICTURE)
{
if (resultCode == RESULT_OK)
{
bitmap = (Bitmap) data.getExtras().get("data");
String path = Images.Media.insertImage(getContentResolver(), bitmap, "", null);
Uri imageUri = Uri.parse(path);
}
Can you please help me to resolve this problem ?
If you want the image to be on disk, let the camera app do it. Add an
EXTRA_OUTPUT
Uri
to yourIntent
, pointing to where you want the image to be stored.(from this sample project)
The
Uri
needs to point to a place where the camera app can write, such as external storage.