I want to use DataTypeConverter.printBase64Binary(.........) in my project. But there is no option coming through intellisense. Am i missing some jar ?
you can use this methods. compile 'commons-codec:commons-codec:1.3'
and i use android.util.Base64 for Android
incompatible / replacement
DatatypeConverter.parseHexBinary
org.apache.commons.codec.binary.Hex.decodeHex(key.toCharArray());
DatatypeConverter.printBase64Binary(finalData);
android.util.Base64.encodeToString(finalData, 16)
DatatypeConverter.parseBase64Binary(encodedInitialData);
org.apache.commons.codec.binary.Hex.decodeHex(key.toCharArray());
Question
Android API provides Base64 to do the conversions you are looking for. However, I used Apache Codec as a compatibility library between different platforms for the client library to get around this issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With