The official documentation states that base64 encode and decode in Android is in the Android.util package. But when you go to use it you will find it's not there!
After much searching, I confirmation Android left base64 encode and decode out of the Android.util package. So what to do? Don't worry, Robert W. Harder has but together a very fast Base64 encoding and decoding class you can include in your project. Here is how to add base64 encode and decode to your project.
Step 1. Visit Robert's website http://iharder.sourceforge.net/current/index.html and download the class file.
Download the complete tutorial here