Search Docs
Loading...
Skip to content

Configuration

In this example, we will show you how to make basic configurations for the mobile editor.

Configuration#

The basic configuration settings shown here are passed directly to Editor.

  • license - the license to activate the Engine with.
license = null, // pass null or empty for evaluation mode with watermark
  • userId - an optional unique ID tied to your application’s user. This helps us accurately calculate monthly active users (MAU). Especially useful when one person uses the app on multiple devices with a sign-in feature, ensuring they’re counted once. Providing this aids in better data accuracy. The default value is null.
userId = "<your unique user id>",
  • baseUri - is used to initialize the engine’s basePath setting before the editor’s onCreate callback is run. It is the foundational URI for constructing absolute paths from relative ones. For example, setting it to the Android assets directory allows loading resources directly from there: file:///android_asset/. This URI enables the loading of specific scenes or assets using their relative paths. The default value is pointing at the versioned IMG.LY CDN but it should be changed in production environments.
baseUri = "file:///android_asset/".toUri(),
  • engineRenderTarget - the target which should be used by the Engine to render. The engine is able to render on both SurfaceView and TextureView. The default value is EngineRenderTarget.SURFACE_VIEW.
engineRenderTarget = EngineRenderTarget.SURFACE_VIEW,

Full Code#

Here’s the full code:

import androidx.compose.runtime.Composable
import androidx.core.net.toUri
import androidx.navigation.NavHostController
import ly.img.editor.Editor
import ly.img.editor.core.engine.EngineRenderTarget
// Add this composable to your NavHost
@Composable
fun BasicEditorSolution(navController: NavHostController) {
Editor(
license = null, // pass null or empty for evaluation mode with watermark
userId = "<your unique user id>",
baseUri = "file:///android_asset/".toUri(),
engineRenderTarget = EngineRenderTarget.SURFACE_VIEW,
) {
// You can set result here
navController.popBackStack()
}
}