import org.apache.commons.codec.binary.Base64;
import java.util.Base64;
It gives me an error when I run the code.
private void upload() {
Bitmap bm = BitmapFactory.decodeFile(mCurrentPhotoPath);
ByteArrayOutputStream bao = new ByteArrayOutputStream();
bm.compress(Bitmap.CompressFormat.JPEG, 50, bao);
byte[] ba = bao.toByteArray();
ba1 = Base64.encodeBytes(ba);
// Upload image to server
new uploadToServer().execute();
}
The errors I got are:
Error:(81, 21) error: cannot find symbol method encodeBytes(byte[])
Error:(43, 25) error: cannot find symbol class Base64