1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
Bitmap yourSelectedImage = BitmapFactory.decodeFile(filepath);
OutputStream outStream = null;
try {
outStream = new FileOutputStream(file);
yourSelectedImage.compress(Bitmap.CompressFormat.JPEG,50, outStream);
outStream.flush();
outStream.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
FileDataSource datasource = new FileDataSource(file);
puis je fait mon traitement pour la joindre au mail
} |