this is my code below which browse imagew gellery and pick image but how do insert image view in database? this code sucessfuly show on screen selected image but not store in da
First make field in sqlite as blob datatype
than get byte and store in databse image.getBytes();
or if you have bitmap than convert into byte array
and store into database
public static byte[] getBitmapAsByteArray(Bitmap bitmap, boolean type) {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
if (type) {
bitmap.compress(CompressFormat.PNG, 0, outputStream);
} else {
bitmap.compress(CompressFormat.JPEG, 0, outputStream);
}
return outputStream.toByteArray();
}