In my app, I am calling camera that should capture picture and store it on given path:
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
public static String pic_path =Environment.getExternalStorageDirectory().toString()+name;
File file = new File(pic_path);
Uri outputFileUri = Uri.fromFile(file);
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
startActivityForResult(intent, REQUEST_CAMERA);
It works fine on devices that have SD card or any kind of External Storage. But it does not work on others (it crashes). So, what is alternative? How would I make this code work for devices without SD card/External Storage?