I need to take pictures using the camera intent in api 23. I am requesting permission to use the camera intent but in an effort to limit the number of permission I need to check or ask for I don't want to save the picture in an app internal storage. But passing file like this to the camera intent doesn't work. I am guessing cause the camera can't write to my apps storage.
try {
mTempImage = File.createTempFile("psn_temp", ".jpg", Controller.getContext().getCacheDir());
} catch (IOException e) {
e.printStackTrace();
}
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(mTempImage));
if i do
File storageDir = Environment.getExternalStorageDirectory();
try {
mTempImage = File.createTempFile(
"psn_temp", /* prefix */
".jpg", /* suffix */
storageDir /* directory */
);
this works but i have to ask for storage permission. Is there a way around this?