How to get JAR file for sun.misc.BASE64Encoder class?

I have code in the Activity class that uses the sun.misc.BASE64Encoder class. But it shows "java.lang.NoClassDefFoundError: sun.misc.BASE64Encoder". Do I need a can? Where can i download it? Please help me.

+4
source share
2 answers

Do not use sun.* classes sun.* . For Base64 on Android, use a native class or add a library to your project that does this (total amount of Apache, etc.). Alternatively, just copy the Android source code into your project (in your own package) if you need to use it on devices up to 2.2.

+3
source

It is available in rt.jar, which comes with Java Java runtime.

In 1.5.0_06: jre \ lib \ rt.jar

0
source

All Articles