Skip to main content
PESDK/Android/Getting Started

Integration

Quick guide to integrating PhotoEditor SDK for Android into your application.

Free Trial#

Our tech is modified to be used for testing purposes without a license key. To start testing, just follow the Integration guide and set the licensePath to null. The editor will simply render a watermark over the preview and final results. And in case you need any technical assistance, make sure to reach out to us: https://img.ly/support. We’ll be glad to help.

Requirements#

PhotoEditor SDK requires:

  • minSdkVersion 21+
  • compileSdkVersion 31+
  • AndroidX
  • Android Gradle Plugin 3.5+
  • Gradle 6.1+
  • Kotlin 1.5.32+

IMG.LY Gradle Plugin#

This plugin provides a convenient way to integrate the PhotoEditor SDK into your application.

IMG.LY repository#

Within your project's settings.gradle file, include the IMG.LY Maven repository:

pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
maven { url 'https://artifactory.img.ly/artifactory/imgly' }
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url 'https://artifactory.img.ly/artifactory/imgly' }
}
}

Plugin Configuration#

After applying the IMG.LY, Kotlin, and KSP plugins, insert the IMGLY.configure block in your module's build.gradle file:

plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'ly.img.android.sdk' version '10.9.0'
// Add KSP-Plugin, the correct version depends on your Kotlin version.
// Can be found here: https://github.com/google/ksp/releases
id 'com.google.devtools.ksp' version '1.6.21-1.+'
}
IMGLY.configure {
pesdk {
enabled true
licensePath 'pesdk_license'
}
modules {
include 'ui:core'
include 'ui:text'
include 'ui:focus'
include 'ui:frame'
include 'ui:brush'
include 'ui:filter'
include 'ui:sticker'
include 'ui:overlay'
include 'ui:transform'
include 'ui:adjustment'
include 'ui:text-design'
include 'backend:serializer'
include 'backend:headless'
include 'backend:background-removal'
include 'backend:sticker-smart'
include 'assets:font-basic'
include 'assets:frame-basic'
include 'assets:filter-basic'
include 'assets:overlay-basic'
include 'assets:sticker-shapes'
include 'assets:sticker-emoticons'
}
}

Ensure you've set the correct version number for the ksp plugin. The version '1.6.21-1.+' used above is just an example. Always refer to the official documentation or repository to fetch the latest version.

The licensePath refers to the path to your license file inside the assets directory. If you do not have a license, set it to null. The above configuration includes all the PhotoEditor SDK modules. You can choose to remove the ones that you do not need. For more information, refer to the modules section.


Note: Prior to version 10.9.0, the syntax imglyConfig { } was employed, which proved unstable due to the Gradle DSL plugins nature.

The revised syntax enhances safety and ensures deterministic outcomes. Migration is recommended wherever feasible.

Instead of imglyConfig {}, you should now utilize:

// Replace the old syntax...
imglyConfig {
pesdk {
...
}
modules {
include ...
}
}
// ...with the new syntax
IMGLY.configure {
pesdk {
...
}
modules {
include ...
}
}


Note: If you have problems with the automatic plugin application, you can skip the plugin check by setting

IMGLY.configure {
skipPluginCheck = true
...
}

Android library module#

If you are integrating the PhotoEditor SDK in an Android library module, IMGLY.configure {} has two optional properties that you can configure -

  • useInheritanceDependencies - Specifies whether the SDK is to be added to the module as api (seen by other modules) or implementation (private to this module). By default, its value is false and the SDK is added as implementation.

  • finalModule - Specifies whether the module is the final module for annotation processing. By default, its value is false. If the consumers of your library module do not use the @OnEvent annotation, set this to true.