I am trying to upload a Google Maps
capture that I made from Android Studio
, but when sending the capture to the server the image arrives empty and I do not know why.
Code:
public void captureScreen() {
SnapshotReadyCallback callback = new SnapshotReadyCallback() {
@Override
public void onSnapshotReady(Bitmap snapshot) {
// TODO Auto-generated method stub
Bitmap bitmap = snapshot;
}
};
mMap.snapshot(callback);
}
Obtengo mi captura y me funciona, pero al codificarla y enviarla no me funciona
{
String imagen;
ByteArrayOutputStream array = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, array);
byte[] imageByte = array.toByteArray();
imagen = Base64.encodeToString(imageByte, Base64.DEFAULT);
Log.d("imagen",imagen);
webservice(imagen);
}
The code PHP
is working because I've done, tests with other images.
Thanks for your reply.