I am developing an app that will allow users to capture images of secure documents and upload those images to a server (a good example of what I’m trying to do is a banking app that allows users to take pictures of checks.)
For security reasons, I do not want the image physically stored on disk at any point, if possible.
When I try to do this with the MediaStore.ACTION_IMAGE_CAPTURE intent, it works… but the resolution is very low. I assume this is to prevent overuse of RAM. I’ve looked around for solutions, but all of the ones I found involve storing the image on the SD card or internal NAND storage. I do not want to do that.
If it is not possible to avoid storing the photo, is there a way for the image to be stored to a location only accessible to my app? I would then delete the file after it’s uploaded. And if I have to do it this way, is there any way to encrypt the photo as it’s being stored?
Here’s a simplification of my current code, in case that helps at all:
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(intent,requestCode);
and
protected void onActivityResult(int requestCode, int resultcode, Intent data)
{
if (resultcode == RESULT_OK)
{
Bitmap bmp = getBitmapFromIntent(data);
}
}
private Bitmap getBitmapFromIntent(Intent intent)
{
Bundle extras = intent.getExtras();
return (Bitmap) extras.get("data");
}
You can save files directly on the device’s internal storage. By default, files saved to the internal storage are private to your application and other applications cannot access them (nor can the user). When the user uninstall your application, these files are removed.