This kind of question seems more like a school homework
assignment, but in case the question is practical, here goes.

What Base64 is:

  http://en.wikipedia.org/wiki/Base64

This article gives plenty of examples and details that someone
can write their own fully-tested implementation in an hour.

But in twenty seconds of using Google, I tried the search string
of "base64 encode in java" and got tons of hits.  The third link
has a fully-tested implementation (based on the same Wikipedia
example data and algorithms).

  http://www.wikihow.com/Encode-a-String-to-Base64-With-Java

Now, it's not good form to just copy code without asking, but
since this is a How-To article published on the web, I don't
think you'll run into copyright issues if you adapt their code
into your application.  There's good discussion in the article
about how the code works, and advice on learning to program.

However, this question is even sillier than that.  The
Android platform even includes a class called Base64 which
does all the encoding and decoding for you.  Without
worrying about incompatibility, testing, or license issues!

  http://developer.android.com/reference/android/util/Base64.html

That class even has an .encodeToString() method that turns
your arbitrary byte[] data into a String ready for use in
sqlite TEXT fields.

Beyond that, I'm really not sure what the actual problem is.

I'm not trying to be rude, but it's depressing when people
ask questions that are so quickly answered with even the
most cursory search first.

On Jan 28, 11:40 am, saex <elpablos...@gmail.com> wrote:
> Hi
>
> Can someone tell me the code to transforma image (maximum of 200KB)
> into Base64 String???
>
> i need to know how to do it with android, because i have to add the
> functionality to upload images to a remote server in my main app
> putting them into a ROW of the database, as a string.
>
> i am searching in google and in StackOverflow but i can't find easy
> examples that i can afford. And also i find some examples but they are
> not talking about to transform into String... and i need to transform
> into string to upload by JSON to my remote server.
>
> thanks

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to