Convert Bitmap Image to Byte array for storing in SQLite database – Android

    private byte[] getBytes(Bitmap photo) {

        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        photo.compress(Bitmap.CompressFormat.PNG, 0, outputStream);
        return outputStream.toByteArray();

    }

Leave a Reply

Your email address will not be published. Required fields are marked *