Android Bitmap to Base64 String code example
Example 1: Android Bitmap to Base64 String
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG, 100, byteArrayOutputStream);
byte[] byteArray = byteArrayOutputStream .toByteArray();
Example 2: Android Bitmap to Base64 String
String encoded = Base64.encodeToString(byteArray, Base64.DEFAULT);