I actually had the exact same question. The original post, the question,
was pretty specific and I'm thankful not everyone on the internet answered
as you originally did or google really wouldn't have any answers would it?
Thankfully, others below you gave brief non-smart-alek responses that
First get the Bitmap of Image , copy to Byte array , get the Base 64 of the
byte by using codec.jar from apache
1. ByteArrayOutputStream baos = new ByteArrayOutputStream();
2. bm.compress(Bitmap.CompressFormat.PNG, 100, baos);
//bm is the bitmap object
3. byte[] b =
thanks to all!
--
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
thanks to all!
--
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
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.
Perhaps the actual question is how to get a byte[] for a given
Bitmap or vice versa. This is, indeed, Android-specific and not
as obvious as the Base64 part of your question.
However, again, with a couple minutes of Google use, I found
this snippet:
// have Bitmap bitmap from somewhere
This class (as well as Base64OutputStream) is only available starting
with API level 8, which may not work for all applications.
-- Kostya
28.01.2011 19:56, Hari Edo пишет:
However, this question is even sillier than that. The
Android platform even includes a class called Base64 which
does
If you do need to convert a byte[] to base64 and back again, the android LVL
has a utility class called Base64 which does exactly that. It is completely
standalone and has no imports whatsoever, so it should work fine with any
version of Android.
--
You received this message because you are
8 matches
Mail list logo