Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 54 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Optable Android SDK [![](https://jitci.com/gh/Optable/optable-android-sdk/svg)](https://jitci.com/gh/Optable/optable-android-sdk)
# Optable Android SDK [![JitPack](https://jitpack.io/v/Optable/optable-android-sdk.svg)](https://jitpack.io/#Optable/optable-android-sdk)

Kotlin SDK for integrating with an [Optable Data Connectivity Node (DCN)](https://docs.optable.co) from an Android
application.

## Contents

- [Requirements](#requirements)
- [Installing](#installing)
- [Using](#using)
- [Identify API](#identify-api)
Expand All @@ -17,31 +18,66 @@ application.
- [Demo Applications](#demo-applications)
- [Building](#building)

## Requirements

- Android 6.0 (API level 23) or later: the SDK's `minSdk` is 23.
- `compileSdk` 34 or later and Android Gradle Plugin 8.1.1 or later, as required by the SDK's AndroidX dependencies.
- JDK 17 or later to build your app: the SDK is compiled to Java 17 bytecode.
- Kotlin apps: Kotlin 2.0 or later, since the SDK's dependencies bring in `kotlin-stdlib` 2.1.
- The `android.permission.INTERNET` permission in your app's `AndroidManifest.xml`. The SDK doesn't declare it, so
your app must:

```xml
<uses-permission android:name="android.permission.INTERNET" />
```

## Installing

This SDK is published using [JitPack](https://jitpack.io/), so you need to add the repository to your application build.
Add the following in your root `build.gradle` at the end of `repositories`:
Add it to the `dependencyResolutionManagement` block of your `settings.gradle`:

```groovy
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
```

Or, in `settings.gradle.kts`:

```kotlin
allprojects {
dependencyResolutionManagement {
repositories {
...
maven {
url 'https://jitpack.io'
}
google()
mavenCentral()
maven("https://jitpack.io")
}
}
```

Projects that still declare repositories in the root `build.gradle` can add the same `maven` line to
`allprojects { repositories { ... } }` instead.

Then add the dependency to the SDK in your app `build.gradle`:

```groovy
dependencies {
implementation 'com.github.Optable:optable-android-sdk:v1.2.0'
}
```

Or, in `build.gradle.kts`:

```kotlin
dependencies {
implementation 'com.github.Optable:optable-android-sdk:VERSION_TAG'
implementation("com.github.Optable:optable-android-sdk:v1.2.0")
}
```

Replace `VERSION_TAG` with the latest or desired [SDK release](https://github.com/Optable/optable-android-sdk/releases).
Replace `v1.2.0` with the latest or desired [SDK release](https://github.com/Optable/optable-android-sdk/releases).

## Using

Expand Down Expand Up @@ -112,7 +148,7 @@ val config = OptableConfig(
providedContext = this,
tenant = "prebidtest",
originSlug = "js-sdk",
host = "ca.edge.optable.co",
host = "na.edge.optable.co",
path = "v2",
insecure = false,
apiKey = API_KEY,
Expand Down Expand Up @@ -702,17 +738,19 @@ The Kotlin and Java demo applications show a working example of the APIs, as wel
an integration with the [Google Ad Manager](https://admanager.google.com/home/) ad server, enabling the targeting of
ads served by GAM to audiences activated in the [Optable](https://optable.co/) DCN.

By default, the demo applications will connect to the [Optable](https://optable.co/) demo DCN at `sandbox.optable.co`and
reference application slug `android-sdk-demo`. The demo apps depend on
the [GAM Mobile Ads SDK for Android](https://developers.google.com/ad-manager/mobile-ads-sdk/android/quick-start) and
load ads from a GAM account operated by [Optable](https://optable.co/).
The demo applications connect to an [Optable](https://optable.co/) demo DCN, tenant `prebidtest`, with the source
slug `android-sdk`. They also show an integration with the
[Prebid Mobile SDK](https://docs.prebid.org/prebid-mobile/pbm-api/android/code-integration-android.html). The demo apps
depend on the [GAM Mobile Ads SDK for Android](https://developers.google.com/ad-manager/mobile-ads-sdk/android/quick-start)
and load ads from a GAM account operated by [Optable](https://optable.co/).

### Building

To build the Kotlin demo app, from [Android Studio](https://developer.android.com/studio), navigate to `File > Open` and
open the `DemoApp/DemoAppKotlin` directory. To build the Java demo app, open the `DemoApp/DemoAppJava` directory. In
both cases, you should be able to build and run the resulting project directly, since it will automatically download the
`co.optable.android_sdk` library from the [JitPack](https://jitpack.io/) Maven repository.
both cases, you should be able to build and run the resulting project directly. By default, the demo apps build the SDK
from the source in this repository (`useReleaseSdk=false` in the demo's `gradle.properties`). Set `useReleaseSdk=true` to
use a published release from [JitPack](https://jitpack.io/) instead.

### Development

Expand Down
Loading