Hello i want to capture image from camera and store into specific folder. For ex. I have folder with name "MyImages" and i want to store captured image with name abc.png into this folder , So how can i set path of FileProvider for following code snippet.
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<files-path name="my_images" path="???"/>
...
Following is my code where i am create my image file.
public File getAlbumDir() {
File storageDir = null;
if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) {
storageDir = new File(Environment.getExternalStorageDirectory(),
"MyImages");
if (storageDir != null) {
if (!storageDir.mkdirs()) {
if (!storageDir.exists()) {
Log.d("CameraSample", "failed to create directory");
return null;
}
}
}
} else {
Log.v(context.getString(R.string.app_name), "External storage is not mounted " +
"READ/WRITE.");
}
return storageDir;
}
public File createImageFile() {
// Create an image file name
String imageFileName = "abc.jpg";
File albumF = getAlbumDir();
File imageF = new File(albumF, imageFileName);
return imageF;
}