Skip to main content
You're viewing documentation for a previous version of this software.Switch to the latest stable version


The PhotoEditor SDK offers a camera implementation for Android to complement your editor, featuring essential camera components as well as live filters.

Camera tool

The PhotoEditor SDK offers a camera implementation for Android to complement your editor, featuring basic essential camera components as well as live filters.

In order to use our camera, you need to instantiate a CameraPreviewActivity using a CameraPreviewBuilder and present it. You can configure the camera to fit your needs by passing a SettingsList object to the builder. If no configuration is passed, the default setup is passed:

public class CameraDemoActivity extends Activity implements PermissionRequest.Response {
// Important permission request for Android 6.0 and above, don't forget to add this!
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
PermissionRequest.onRequestPermissionsResult(requestCode, permissions, grantResults);
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
public void permissionGranted() {}
public void permissionDenied() {
/* TODO: The Permission was rejected by the user. The Editor was not opened,
* Show a hint to the user and try again. */
public static int PESDK_RESULT = 1;
private SettingsList createPesdkSettingsList() {
// Create a empty new SettingsList and apply the changes on this referance.
SettingsList settingsList = new SettingsList();
// If you include our asset Packs and you use our UI you also need to add them to the UI,
// otherwise they are only available for the backend
// See the specific feature sections of our guides if you want to know how to add our own Assets.
// Set custom camera image export settings
.setExportDir(Directory.DCIM, "SomeFolderName")
// Set custom editor image export settings
.setExportDir(Directory.DCIM, "SomeFolderName")
return settingsList;
protected void onCreate(Bundle savedInstanceState) {
private void openCamera() {
SettingsList settingsList = createPesdkSettingsList();
new CameraPreviewBuilder(this)
.startActivityForResult(this, PESDK_RESULT);
protected void onActivityResult(int requestCode, int resultCode, android.content.Intent intent) {
super.onActivityResult(requestCode, resultCode, intent);
if (resultCode == RESULT_OK && requestCode == PESDK_RESULT) {
// Editor has saved an Image.
EditorSDKResult data = new EditorSDKResult(intent);
data.notifyGallery(EditorSDKResult.UPDATE_RESULT & EditorSDKResult.UPDATE_SOURCE);
Log.i("PESDK", "Source image is located here " + data.getSourceUri());
Log.i("PESDK", "Result image is located here " + data.getResultUri());
// TODO: Do something with the result image
// OPTIONAL: read the latest state to save it as a serialisation
SettingsList lastState = data.getSettingsList();
try {
new IMGLYFileWriter(lastState).writeJson(new File(
} catch (IOException e) { e.printStackTrace(); }
} else if (resultCode == RESULT_CANCELED && requestCode == PESDK_RESULT) {
// Editor was canceled
EditorSDKResult data = new EditorSDKResult(intent);
Uri sourceURI = data.getSourceUri();
// TODO: Do something...

Disable editor to open#

To prevent the 'editor screen' to open after taking a photo and to stay on 'capture mode' use this code:


For more details, take a look at our getting started section.