I try to convert a bitmap file in android, to an array of bytes and then pass it to a web service asmx, and since it is saved in a sql database, but I get compatibility error, would anyone know how I can do it?
I try to convert a bitmap file in android, to an array of bytes and then pass it to a web service asmx, and since it is saved in a sql database, but I get compatibility error, would anyone know how I can do it?
The best way to convert a bitmap to an array of bytes is as follows:
Bitmap bmp = intent.getExtras().get("data");
ByteArrayOutputStream stream = new ByteArrayOutputStream();
bmp.compress(Bitmap.CompressFormat.PNG, 100, stream);
byte[] byteArray = stream.toByteArray();
bmp.recycle();
Try to see if this way you have no problems.