skwalking
11/26/2021, 10:39 AMval file = File(myDir, fname)
val out = FileOutputStream(file)
bitmap.asAndroidBitmap().compress(Bitmap.CompressFormat.JPEG, 100, out)
out.flush()
out.close()
and used to share it:
fun shareFile(image: StatusModel, context: Context) {
val intent = Intent(Intent.ACTION_SEND)
intent.type = "image/jpeg"
intent.putExtra(Intent.EXTRA_STREAM, image.fileUri)
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
context.startActivity(Intent.createChooser(intent, "Share via"))
}
But I'm noticing size difference in both files.
Size of shared file< Size of copied file
How to send file with same quality and size ?
(Note: when shared I used a file manager app (x-plore) to copy shared file into a folder to compare it's quality and size)