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#

In the settings.gradle file at the root of your project, add 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' }
}
}

Configuring Plugin#

Apply the IMG.LY and Kotlin plugin, and add the imglyConfig block into your module's build.gradle file:

plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'ly.img.android.sdk' version '10.7.0'
}
imglyConfig {
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'
}
}

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.

Android library module#

If you are integrating the PhotoEditor SDK in an Android library module, imglyConfig 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.