Search
Loading...
Skip to content

Existing Project Setup

This guide shows you how to integrate the CreativeEditor SDK into your existing Android Jetpack Compose project. Follow these steps to learn how to:

  • add the necessary dependencies.
  • configure the editor.
  • test the integration.

Who Is This Guide For?#

This guide is for developers who:

  • Have an existing Android Jetpack Compose project
  • Want to add CreativeEditor SDK features to their app
  • Need to understand common integration patterns
  • Want to test available editing capabilities and workflows

What You’ll Achieve#

By following this guide, you’ll perform the following tasks:

  • Project Integration: Add CreativeEditor SDK to your existing Android project
  • Editor Implementation: Implement the editor with proper lifecycle management
  • Testing: Verify the integration works correctly
  • Customization: Learn how to customize the editor for your use case

View Android Examples

Android Documentation

Prerequisites#

Development Environment#

  • Android Studio (latest version)
  • Android SDK (API level 24 or higher)
  • Kotlin 1.9.10 or higher
  • Gradle 8.4 or later
  • Jetpack Compose BOM 2023.05.01 or higher

Platform Requirements#

  • Android: API level 24 (Android 7.0) or higher
  • Supported ABIs: arm64-v8a, armeabi-v7a, x86_64, x86

License#

Verify Your Setup#

Before starting, verify your Android development environment:

Terminal window
gradle --version

This command checks your Gradle installation and reports any issues to resolve before proceeding.

Step 1: Add Dependencies to Your Existing Project#

1.1 Add IMG.LY Repository#

Update your settings.gradle.kts file to include the IMG.LY repository:

settings.gradle.kts
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven {
name = "IMG.LY Artifactory"
url = uri("https://artifactory.img.ly/artifactory/maven")
mavenContent {
includeGroup("ly.img")
}
}
}
}

1.2 Add Editor Dependencies#

Update your app/build.gradle.kts file to include the CreativeEditor SDK:

build.gradle.kts
dependencies {
// CreativeEditor SDK
implementation("ly.img:editor:1.57.0")
// Jetpack Compose BOM
implementation(platform("androidx.compose:compose-bom:2025.04.01"))
implementation("androidx.activity:activity-compose")
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.ui:ui-tooling-preview")
implementation("androidx.compose.material3:material3")
implementation("androidx.compose.runtime:runtime")
implementation("androidx.compose.foundation:foundation")
}

1.3 Configure Android Settings#

Ensure your app/build.gradle.kts has the correct Android configuration:

build.gradle.kts
android {
compileSdk = 34
defaultConfig {
minSdk = 24
targetSdk = 34
}
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.15"
}
kotlinOptions {
jvmTarget = "17"
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
}

1.4 Sync Project#

After adding the dependencies, sync your project:

In Android Studio, click Sync Project with Gradle Files to download and configure all dependencies. This downloads and installs the CreativeEditor SDK and its dependencies automatically through Gradle.

Step 2: Implement the Editor Integration#

2.1 Create Editor Composable#

Create a new Kotlin file (for example, EditorComposable.kt) in your project:

EditorComposable.kt
import androidx.compose.runtime.Composable
import ly.img.editor.DesignEditor
import ly.img.editor.EngineConfiguration
import ly.img.editor.rememberForDesign
@Composable
fun EditorComposable() {
val engineConfiguration = EngineConfiguration.rememberForDesign(
license = "<your license here>", // Get your license from https://img.ly/forms/free-trial
userId = "<your unique user id>", // A unique string to identify your user/session
)
DesignEditor(
engineConfiguration = engineConfiguration,
onClose = {
// Close the editor here
// If using a navigation library, call pop() or navigateUp() here
}
)
}

2.2 Update Your MainActivity#

Modify your existing MainActivity.kt to include the editor:

MainActivity.kt
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.ui.Modifier
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
MaterialTheme {
Surface(
modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colorScheme.background
) {
EditorComposable()
}
}
}
}
}

2.3 Add Required Permissions#

Update your AndroidManifest.xml to include necessary permissions:

AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="your.package.name">
<!-- Internet permission -->
<uses-permission android:name="android.permission.INTERNET" />
<!-- Camera and Microphone-->
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<!-- Modern storage permissions -->
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
<!-- For devices running Android 9 or lower only -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="29" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="29" />
<!-- Photo Picker permission (API 34+) -->
<uses-permission android:name="android.permission.READ_MEDIA_VISUAL_USER_SELECTED" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.YourApp">
<activity
android:name=".MainActivity"
android:exported="true"
android:theme="@style/Theme.YourApp">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

Step 3: Test Your Editor Integration#

3.1 Build and Run#

Build your Android project using Gradle:

3.2 Test on Android Device#

Terminal window
./gradlew installInternalDebug

3.3 Verify Features#

After launching your app, verify these features work correctly:

  • Editor Launch: The CreativeEditor SDK opens without errors
  • Template Selection: You can browse and select templates
  • Editing Tools: All editing tools are accessible and functional
  • Export: You can export edited content successfully
  • Navigation: The editor closes properly when finished

3.4 Common Test Scenarios#

  • Photo Editing: Import and edit photos
  • Text Addition: Add and customize text elements
  • Template Usage: Apply and customize templates
  • Export Options: Test different export formats
  • Performance: Verify smooth operation on target devices

Step 4: Customize for Your Use Case#

4.1 Editor Configuration Options#

The CreativeEditor SDK offers different presets for common use cases:

Available Editor Types Summary#

Editor TypeRequired ParametersOptional ParametersUse Case
rememberForDesignlicenseuserId, baseUri, sceneUri, renderTargetGeneral design creation
rememberForPhotolicense, imageUriimageSize, userId, baseUri, renderTargetPhoto editing
rememberForVideolicenseuserId, baseUri, sceneUri, renderTargetVideo editing
rememberForApparellicenseuserId, baseUri, sceneUri, renderTargetT-shirt/apparel design
rememberForPostcardlicenseuserId, baseUri, sceneUri, renderTargetPostcard creation
Editor TypeUse CaseKotlin Implementation
PhotoEditorPhoto editing and enhancementPhotoEditor composable
DesignEditorGraphic design and templatesDesignEditor composable
VideoEditorVideo editing and effectsVideoEditor composable

4.2 Custom Configuration#

You can customize the editor behavior:

EditorComposable.kt
@Composable
fun CustomEditorComposable() {
val engineConfiguration = EngineConfiguration.rememberForDesign(
license = "<your license here>",
userId = "<your unique user id>",
// Add custom configuration here
)
DesignEditor(
engineConfiguration = engineConfiguration,
onClose = { /* Handle close */ },
onExport = { result -> /* Handle export */ }
)
}

Step 5: Troubleshooting#

Common Issues and Solutions#

Gradle Sync Issues#

  • Problem: Repository not found
  • Solution: Verify the IMG.LY repository URL in settings.gradle.kts

Compilation Errors#

  • Problem: Missing dependencies
  • Solution: Ensure you’ve installed all Jetpack Compose dependencies.

Runtime Errors#

  • Problem: Invalid license
  • Solution: Verify your license key is correct and valid

Performance Issues#

  • Problem: Slow editor loading
  • Solution: Check device specifications and memory usage

Integration Issues#

  • Problem: Editor not displaying
  • Solution: Verify the composable is properly called in your activity

Step 6: Next Steps#

Advanced Features#

  • Implement custom asset sources
  • Add custom filters and effects
  • Integrate with your backend services
  • Implement user authentication

Other Integrations#

  • Explore camera integration
  • Add video editing capabilities
  • Implement batch processing
  • Add cloud storage integration

Production Considerations#

  • Optimize for performance
  • Implement proper error handling
  • Add analytics and monitoring
  • Test on different device configurations

Additional Resources#