Answers for "android convert base64 to string"

0

how to use base64.getdecoder() android

import android.util.Base64;

...

String testValue = "Hello, world!";

byte[] encodeValue = Base64.encode(testValue.getBytes(), Base64.DEFAULT);
byte[] decodeValue = Base64.decode(encodeValue, Base64.DEFAULT);

Log.d("ENCODE_DECODE", "defaultValue = " + testValue);
Log.d("ENCODE_DECODE", "encodeValue = " + new String(encodeValue));
Log.d("ENCODE_DECODE", "decodeValue = " + new String(decodeValue));
Posted by: Guest on January-12-2021
0

Android Bitmap to Base64 String

ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();  
bitmap.compress(Bitmap.CompressFormat.PNG, 100, byteArrayOutputStream);
byte[] byteArray = byteArrayOutputStream .toByteArray();
Posted by: Guest on June-03-2021

Code answers related to "android convert base64 to string"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language