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 likingsAshwani– Ashwani2012-10-16 09:29:54 +00:00Commented Oct 16, 2012 at 9:29
- I tried to import import javax.xml.bind.DataTypeConverter; .But a error is prompting "Create class DataTypeConverter class".Mufrah– Mufrah2012-10-16 10:15:46 +00:00Commented 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.Mufrah– Mufrah2012-10-16 10:49:55 +00:00Commented 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/…)Mufrah– Mufrah2012-10-16 11:41:14 +00:00Commented Oct 16, 2012 at 11:41
Add a comment |
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()); 1 Comment
Faisal
it works for me for scribd java support for convert data type in android Pie API 28