tags:

views:

96

answers:

2

How to decode a base64 encoded string to byte array on Android API level 7?

Can it be done using any standard packages of Java?

Should i copy the source code from google search results?

Should i re-implement encoder and decoder according to RFC?

PS: API level 8 has util package android.util.Base64 that does this, but i have to do development based on API level 7.

+1  A: 

Not sure if there's n or not, but if there isn't, I wouldn't implement your own, I'd use something like Mikael Grev's MiGBase64 which has been extensively tested and (as far as I can see) should work on Android

tim_yates
A: 

You can use this class,

org.bouncycastle.util.encoders.Base64

BouncyCastle is included in Level 7.

ZZ Coder
I couldn't find the BouncyCastle in the android.jar packages list at http://developer.android.com/reference/packages.html.
Suresh
You are right. It wasn't there. We include a BC jar and I thought it came with Android.
ZZ Coder