I use code below to make a picture with camera. Instead of saving I would like to encode it to Base64 and after that pass it to another API as an input. I can\'
Base64
Just for converting from bitmap to base64 string in kotlin I use:
private fun encodeImage(bm: Bitmap): String? { val baos = ByteArrayOutputStream() bm.compress(Bitmap.CompressFormat.JPEG, 100, baos) val b = baos.toByteArray() return Base64.encodeToString(b, Base64.DEFAULT) }