fotilo is an Android Camera App. It can be called via an Intent and will return all the photos taken in the result. This is similar to MediaStore.ACTION_IMAGE_CAPTURE
but for multiple photos. It additionally allows configuring some camera options from the calling App like resolution and aspect ratio.
You can configure the photos taken by this app by passing parameters in an Intent
.
Intent intent = new Intent("de.evosec.fotilo");
Put your resolution in the intent. fotilo will automatically select the correct native resolution that has the same aspect ratio. If the camera does not natively support your resolution the next highest available with the same aspect ratio will be selected.
intent.putExtra("width", 1920);
intent.putExtra("height", 1080);
You can also pass an aspect ratio:
intent.putExtra("aspectratio", (double) width / (double) height);
To limit the number of photos to take, put the following in your intent:
intent.putExtra("maxPictures", 2);
After the photos are taken, you can access them from the activityResult in your own Activity:
public void getImagesFromActivityResult(Intent data) {
Bundle bundle = data.getBundleExtra("data");
try {
List<String> photos = bundle.getStringArrayList("pictures");
String error = bundle.getString("error");
if(error == null && photos != null) {
fillImageAdapter();
} else if (error != null) {
Toast.makeText(this, error, Toast.LENGTH_SHORT).show();
}
} catch (Exception ex) {
Log.d(TAG, ex.getMessage());
}
}