0
Good afternoon,
I am as a doubt, how can I convert a URI to Bitmap and then convert to Base64 so I can send to the Database.
private void abrirCamera() {
fileUri = getOutputPictureUri("GRP");
if (fileUri != null) {
// Cria o intent para chamar a câmara
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
// seta o caminho do arquivo para guardar a foto
intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri);
// inicia a captura da foto
startActivityForResult(intent, CAM_REQUEST);
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == CAM_REQUEST) {
if (resultCode == RESULT_OK) {
Foto1.setImageURI(fileUri);
}
}
}
Behold here and here.
– StatelessDev