I have some code in my Activity class that uses sun.misc.BASE64Encoder
class. But it is showing java.lang.NoClassDefFoundError : sun.misc.BASE64Encoder
. Do I need the jar
? Where can I download it from?
Advertisement
Answer
Don’t use sun.*
classes. For Base64 in Android, use its native class or add a library to your project that does this (Apache commons, etc.). Alternatively just copy the Android source code to your project (in your own package), if you need to use it on pre-2.2 devices.