0

I stored the images into the databases with blob type. I want to display those images into grid view. I'm a newbie in android. Any idea?

kyawsanwin
  • 23
  • 1
  • 2
  • 8

1 Answers1

1

BitmapFactory.decodeByteArray will do the trick. see this answer - byte[] to image android which is more or less the same as what you want to do. Read the blob from your database in

byte[] blob = cursor.getBlob(cursor.getColumnIndex("yourimageblob")); 
Bitmap bmp=BitmapFactory.decodeByteArray(blob,0,blob.length);
ImageView image=new ImageView(this);
image.setImageBitmap(bmp);

To then show the images in gridview, the answer is here - Showing Images in GridView

Hope this helps

Community
  • 1
  • 1
Joeblackdev
  • 7,217
  • 24
  • 69
  • 106