Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No DataTypeConverter Method option in android

Tags:

java

android

I want to use DataTypeConverter.printBase64Binary(.........) in my project. But there is no option coming through intellisense. Am i missing some jar ?

like image 849
Mufrah Avatar asked Oct 16 '12 09:10

Mufrah


2 Answers

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

like image 181
David Hackro Avatar answered Sep 29 '22 23:09

David Hackro


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.

like image 39
Archimedes Trajano Avatar answered Sep 30 '22 00:09

Archimedes Trajano