Exemplo n.º 1
0
 private static String encodeToBase64(
     Bitmap image, Bitmap.CompressFormat compressFormat, int quality) {
   ByteArrayOutputStream byteArrayOS = new ByteArrayOutputStream();
   image.compress(compressFormat, quality, byteArrayOS);
   return Base64.encodeToString(byteArrayOS.toByteArray(), Base64.DEFAULT);
 }
Exemplo n.º 2
0
  // Convert image to base64 for server sending.
  public String getImageBase64() {

    return Base64.encodeToString(photoByteArray, 0);
  }