0
ImageView imgProduto = (ImageView) findViewById(R.id.imgProduto);
Bitmap bitmap = ((BitmapDrawable)imgProduto.getDrawable()).getBitmap();
ByteArrayOutputStream saida = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG,100,saida);
final byte[] img = saida.toByteArray();
produto.setFoto(img);
What is the doubt?
– ramaral
I used this code to convert an image into an array of bytes but sending it to the database by the product.setFoto(img) did not save
– fabricio b.
Which bank are you using? Is it local or remote? Are you using a ORM for bank access?
– Grupo CDS Informática
I am using MYSQL Local with a Web Service REST in Java
– fabricio b.