9

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

4
  • have you imported javax.xml.bind.DatatypeConverter? if this is not an issue try Window -> Preferences -> Java/Editor/Content Assist and select your likings Commented Oct 16, 2012 at 9:29
  • I tried to import import javax.xml.bind.DataTypeConverter; .But a error is prompting "Create class DataTypeConverter class". Commented Oct 16, 2012 at 10:15
  • i tried to add jaxb-api-2.2.jar .when i compiled my project i get this error <br/> [2012-10-16 15:48:07 - DistimoApp] Dx trouble processing "javax/xml/bind/Binder.class": Ill-advised or mistaken usage of a core class (java.* or javax.*) when not building a core library. This is often due to inadvertently including a core library file in your application's project, when using an IDE (such as Eclipse). If you are sure you're not intentionally defining a core class, then this is the most likely explanation of what's going on. Commented Oct 16, 2012 at 10:49
  • its working .i follow this article ...awesome [Add a third party jar in android and make it delvik converted jar ](stackoverflow.com/questions/3642928/…) Commented Oct 16, 2012 at 11:41

2 Answers 2

4

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

Sign up to request clarification or add additional context in comments.

1 Comment

it works for me for scribd java support for convert data type in android Pie API 28
2

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.