I know that it is possible to send email attachments when you have a valid file path and URI.
final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND_MULTIPLE);
emailIntent.setType("plain/text");
ArrayList<Uri> uris = new ArrayList<Uri>();
String[] filePaths = new String[] {image1 Path,image2 path};
for (String file : filePaths) {
File fileIn = new File(file);
Uri u = Uri.fromFile(fileIn);
uris.add(u);
}
if ( !(app_preferences.getString("email", "") == null || app_preferences.getString("email", "").equals(""))) {
emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[] {app_preferences.getString("email", "")});
}
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Subject name");
emailIntent.putExtra(Intent.EXTRA_TEXT, "Please find the attachment.");
emailIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);
startActivity(Intent.createChooser(emailIntent, "Email:"));
I store my images in a DB (as BLOB). (I know it is considered as not a good practice but I've got enough good reasons to do so).
I know it's possible to select the images out of the DB, store it in the SD, send email, and then deleting the images off the SD card, but I'm not looking for this kind of solution.
So, is it possible just to attach a bitmap without any actual file path(since it's stored in my DB).