1import android.util.Base64;
2
3...
4
5String testValue = "Hello, world!";
6
7byte[] encodeValue = Base64.encode(testValue.getBytes(), Base64.DEFAULT);
8byte[] decodeValue = Base64.decode(encodeValue, Base64.DEFAULT);
9
10Log.d("ENCODE_DECODE", "defaultValue = " + testValue);
11Log.d("ENCODE_DECODE", "encodeValue = " + new String(encodeValue));
12Log.d("ENCODE_DECODE", "decodeValue = " + new String(decodeValue));
13