This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

[TUTORIAL] How to base64 encode decode Android  RSS feed

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 (thanks Robert!). 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.


Step 2. The zip file you downloaded in step 1 includes the base64 class and a folder with examples and documentation.


Step 3. Copy the Base64.java class file into your project. Copy into your appropriate "src" folder.


Step 4. Refresh your project so the new file is included.


Step 5. When the Base64.java file is included in your project, you will get the following error "The declared package does not match the expected package". Fix this by opening the class file and adding a package declaration that matches your project.


Step 6. Done. Your ready to base64 encode and decode.


Android Code Monkey
http://androidcodemonkey.blogspot.com/
 
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for posting this...
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!