I have been searching for the following issue for three days
My Code is as following
private void openCamera () {
try {
Intent captureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
String fileName = Constants.IMAGE_CAPTURE_FILE_NAME_PREFIX + System.currentTimeMillis() + Constants.IMAGE_FILE_EXT_JPG;
mImageFile = new File(FileManager.getInstance().getFileFullName(Constants.IMAGE_FOLDER, fileName));
captureIntent.putExtra(MediaStore.EXTRA_OUTPUT, mImageFile);
startActivityForResult(captureIntent, Constants.ACTIVITY_CAMERA_REQUEST_CODE);
} catch(ActivityNotFoundException anfe) {
String errorMessage = "Whoops - your device doesn't support capturing images!";
Toast toast = Toast.makeText(ImagesSelectorActivity.this, errorMessage, Toast.LENGTH_SHORT);
toast.show();
}
}
public String getFileFullName(String folderName, String fileName) {
String filepath;
if (PhoneUtils.isSDCardFound() == true)
filepath = Environment.getExternalStorageDirectory().getPath();
else
filepath = Environment.getDataDirectory().getPath();
File file = new File(filepath, folderName);
if (!file.exists()) {
file.mkdirs();
}
return (file.getAbsolutePath() + "/" + fileName);
}
On Activity results
if(requestCode == Constants.ACTIVITY_CAMERA_REQUEST_CODE) {
Uri picUri = data.getData();
if (picUri == null) {
Bitmap bitmap = (Bitmap) data.getExtras().get("data");
Uri tempUri = PhoneUtils.getBitmapUri(getApplicationContext(), bitmap);
Log.i("AMIRA", tempUri.toString());
}
performPreview(picUri);
}
The problem that the image is not saved in my folder, and the url that return is the thumbnail uri
I need to save the image after capture in the path that I need and to be able to read the full size of image.
I can't find the image captured from camera in any place in the device.