I currently use this method to effectively convert an image File into a content uri...
protected static Uri convertFileToContentUri(Context context, File file) throws Exception {
ContentResolver cr = context.getContentResolver();
String imagePath = file.getAbsolutePath();
String imageName = null;
String imageDescription = null;
String uriString = MediaStore.Images.Media.insertImage(cr, imagePath, imageName, imageDescription);
return Uri.parse(uriString); }
...but the problem is that it requires the android.permission.WRITE_EXTERNAL_STORAGE
permission.
Is there any way to perform the same conversion without requiring that permission?