0
Good morning,
I would like to ask a question, my APP so far the guy takes a photo of the phone and is in an Imageview (Ex: img1), I need to be created a name defined by me in an example variable: 04102018_Foto1.jpg, would have some form so that I can send to the BD with that name defined by me ?
Code:
String dataAtualFormatada = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss").format(System.currentTimeMillis());
btnTirarFoto.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent((MediaStore.ACTION_IMAGE_CAPTURE));
startActivityForResult(intent, 0);
// Toast.makeText(TelaAtestado.this, "Atestado cadastrado com sucesso! ", Toast.LENGTH_LONG).show();
}
});
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
Bitmap bitmap = (Bitmap) data.getExtras().get("data");
ByteArrayOutputStream out = new ByteArrayOutputStream();
// Comprimir Imagem = PNG/JPG ----- QUALITY:
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, out);
img1.setImageBitmap(bitmap);
}
}
Thank you so much for your help, I’ll be testing and I’ll be all right !
– Ronaldo Amaral
I have a question, if I want to pass it along with the other Strings to send via Json as I would ex: String contract = txtContract.gettext(). toString(); String data = txtHorario.gettext(). toString(); String remarks = txtObservation.gettext(). toString();
– Ronaldo Amaral