2019 Jun. 26.
$ cd AndroidStudio/PROJECT
$ ./gradlew assembleDebug
2019 Jun. 26.
$ cd AndroidStudio/PROJECT
$ ./gradlew assembleDebug
// BitmapクラスbitmapInstanceをバイト配列byteArrayImageに変換する ByteArrayOutputStream outStream = new ByteArrayOutputStream(); bitmapInstance.compress(Bitmap.CompressFormat.JPEG, 80, outStream); byte[] byteArrayImage = outStream.toByteArray(); // byteArrayImageをメールに添付にする final MimeBodyPart filePart = new MimeBodyPart(); filePart.setDataHandler(new DataHandler( new ByteArrayDataSource(byteArrayImage, "image/jpeg"))); String fileName = "FILE_NAME"; try { filePart.setFileName(MimeUtility.encodeWord(fileName)); } catch (UnsupportedEncodingException e) { e.printStackTrace(); }