Is there a way to get the real storage path of the image captured by the Android camera?
I want to know a camera app developed by the OEM itself.
In short, by taking hostages and demanding that OEMs hand over this information, you have no means to get it. Finally:
-
You don't have a good way of knowing which camera app was preinstalled on the device, or even if it was
-
You have no way of knowing if the OEM wrote this camera app, not licensing it from some third party.
-
You have no way of knowing where the camera app will store images, as the app can store images anywhere, perhaps via user-supplied configuration data (eg, "let's connect the camera to your Dropbox account!")
-
You don't even know if the camera will store images in a location that you can access (for example, camera apps can record to removable media on Android 4.4+ that your app cannot access)
source to share
I'm not sure if this is your answer (or if you even want an answer?), But here it is:
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
imageFile = new File(
Environment
.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), "goQuiz/profilePic.jpg"
);
Uri tempuri = Uri.fromFile(imageFile);
intent.putExtra(MediaStore.EXTRA_OUTPUT, tempuri);
intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1);
startActivityForResult(intent, 0);
myVar = imageFile.getAbsolutePath();
Currently myVar
stores the full path where the photo is saved.
Basically get a variable to save file.getAbsolutePath()
for you.
source to share