[android-developers] Image not displaying from MySQL database
Hey guys,
I have an external database set up and it works fine with the required
fields returning the values wanted. When I then try to select a BLOB
image from the database it doesnt appear to be displaying on my
application. The php file works fine I believe.
For the PHP file I add the following lines of code:-
{
$array=$e;
$array['Paintingpic']=base64_encode($row['Paintingpic']);
$output[]=$array;
}
which encodes the image, then when I try to decode it in my Java file
using the Base64.decode and attempt to display it using Imageview it
doesnt display. My Java code is below:-
byte[] bit = Base64.decode(json_data.getString("Paintingpic"),0);
ImageView image =
(ImageView)convertView.findViewById(R.id.image);
Bitmap
bmp=BitmapFactory.decodeByteArray(bit,0,bit.length);
image.setImageBitmap(bmp);
Any help would be appreciated. Thanks for your time.
--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home