In my case, /storage/emulated/0/ corresponds to my device's root path. For example, when i take a photo with my phone's default camera application, the images are saved automatically /store/emulated/0/DCIM/Camera/mypicname.jpeg
For example, suppose that you want to store your pictures in /Pictures directory, namely in Pictures directory which exist in root directory. So you use the below code.
File storageDir = Environment.getExternalStoragePublicDirectory( Environment.DIRECTORY_PICTURES );
If you want to save the images in DCIM or Downloads directory, give the below arguments to the Environment.getExternalStoragePublicDirectory() method shown above.
Environment.DIRECTORY_DCIM
Environment.DIRECTORY_Downloads
Then specify your image name :
String imageFileName = "JPEG_" + timeStamp + "_";
Then create the file object as shown below. You specify the suffix as the 2nd argument.
File image = File.createTempFile(
imageFileName, // prefix
".jpg", // suffix
storageDir // directory
);