Skip to main content

Setting up Development Environment

LLM Prompts Available

For LLM-assisted SDK integration, see the Android Prompts section. Step-by-step and integrated prompts are available.

Dependency Setting​

To use the FLOWER SDK in your Android project, add the library to Gradle dependencies through AnypointMedia's Maven repository.

The SDK also resolves part of its transitive dependencies from Google's Maven repository and JitPack, so google() and https://jitpack.io must be declared together with the AnypointMedia repository.

repositories {
google()
maven(url = "https://maven.anypoint.tv/repository/public-release")
maven(url = "https://jitpack.io")
}

...

dependencies {
implementation("flower-sdk:sdk-android-ott:X.X.X")
}
caution

If google() or https://jitpack.io is missing from the repository list, the build fails while resolving the SDK's transitive dependencies. If your project declares repositories in settings.gradle(.kts) under dependencyResolutionManagement, add them there instead of in the module-level build.gradle(.kts).

Core Library Desugaring​

The FLOWER SDK is built with core library desugaring enabled, and its AAR metadata requires your app module to enable it too. Without it, the build fails at checkDebugAarMetadata. In Groovy DSL, use coreLibraryDesugaringEnabled true.

android {
compileOptions {
isCoreLibraryDesugaringEnabled = true
}
}

dependencies {
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.5")
}

Additional Dependency for Media3 ExoPlayer (FlowerMedia3ExoPlayer)​

If your app uses Media3 ExoPlayer via FlowerMedia3ExoPlayer, you must add a Media3 version-specific companion artifact in addition to the core sdk-android-ott dependency.

Starting from version 2.9.16, the FLOWER SDK separates the Media3 adapter into per-version artifacts to avoid binary compatibility issues caused by Media3 API differences between versions. The companion artifact depends on sdk-android-ott, so both must be added together — the companion alone is not sufficient.

Supported androidx.media3 versions: 1.2.1 and above. Choose the artifact that matches the androidx.media3 version used by your app:

Your androidx.media3 versionArtifact to add
1.2.1 and aboveflower-sdk:sdk-android-ott-media3-{androidx.media3-version}:X.X.X
dependencies {
implementation("flower-sdk:sdk-android-ott:X.X.X")

// Required only when using FlowerMedia3ExoPlayer.
// Pick the artifact that matches your androidx.media3 version.
implementation("flower-sdk:sdk-android-ott-media3-1.10.1:X.X.X")
}
note

The core sdk-android-ott artifact is always required. The sdk-android-ott-media3-* artifact is only needed when integrating with Media3 ExoPlayer through FlowerMedia3ExoPlayer, and it depends on sdk-android-ott. If you use FlowerExoPlayer2 (legacy ExoPlayer) or FlowerBitmovinPlayer, you do not need to add it.

info

If your project uses an androidx.media3 version that is not covered by the artifacts listed above (for example, versions below 1.2.1), please contact us at dev-support@anypointmedia.com.

Google IMA SDK Version​

Starting from version 2.9.32, the FLOWER SDK is built with Google IMA SDK 3.40.0. Each release is also published as X.X.X-IMA_3_36_0, a backward-compatible version built with Google IMA SDK 3.36.0. If your app cannot meet the requirements of the default version, use the backward-compatible version.

X.X.X (default)X.X.X-IMA_3_36_0 (backward-compatible)
Google IMA SDK3.40.03.36.0
minSdk24 or higher21 or higher
compileSdk35 or higher33 or higher
Android Gradle Plugin8.6.0 or higher8.0.0 or higher
androidx.core1.10.0 or higherNo requirement
note

When using the default version, if your app's androidx.core version is lower than 1.10.0, add androidx.core:core:1.10.0 or higher to your app's dependencies. Otherwise, a release build with R8 can fail with Missing class androidx.core.app.PendingIntentCompat.

dependencies {
implementation("flower-sdk:sdk-android-ott:X.X.X-IMA_3_36_0")

// Required only when using FlowerMedia3ExoPlayer.
implementation("flower-sdk:sdk-android-ott-media3-1.10.1:X.X.X-IMA_3_36_0")
}
caution

Add the same -IMA_3_36_0 suffix to every FLOWER SDK dependency, including sdk-android-ott-media3-*. If the default version and the suffixed version are mixed, Gradle resolves the default version and the requirements of the default version apply.

Android Cleartext Traffic Exception Configuration​

When using the FLOWER SDK, a specific domain must be configured as a cleartext traffic exception in order for the SDK to communicate properly over HTTP. Starting from Android 9 (API level 28), cleartext (HTTP) traffic is blocked by default.

You can choose one of the two methods below:

  1. Allow cleartext traffic for a specific domain using Network Security Config (Recommended)
  2. Enable cleartext traffic globally using usesCleartextTraffic="true"

1. Create Network Security Config File​

Create the following file:

app/src/main/res/xml/network_security_config.xml

2. Add the Following Configuration​

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">
prod-reds-device-ad-distributor.ap-northeast-2.elasticbeanstalk.com
</domain>
</domain-config>
</network-security-config>

cleartextTrafficPermitted="true" → Allows HTTP traffic only for this domain.

includeSubdomains="true" → Also allows all subdomains (set to false if not needed).

3. Apply It in AndroidManifest.xml​

Add the following inside the <application> tag:

<application
android:name=".MyApplication"
android:networkSecurityConfig="@xml/network_security_config"
android:usesCleartextTraffic="false"
... >

This approach limits HTTP access to the specified domain only and is more secure.

You can enable HTTP for all domains by setting:

<application
android:name=".MyApplication"
android:usesCleartextTraffic="true"
... >

Important Notes

  • This allows HTTP traffic for all domains.
  • In this case, Network Security Config is not required.
  • This approach is not recommended for production environments due to security risks.

(Reference) Android Version Behavior​

Android VersionBehavior
API 28+ (Android 9+)HTTP blocked by default
API 27 and belowHTTP allowed by default