LogoLogo
  • Getting started
  • Migration guide
  • Test your implementation
  • Release notes
  • Ad Formats
    • Interstitial
    • Rewarded
    • Small Banner / MREC
    • Thumbnail
  • Privacy
    • Privacy compliance
  • Help
    • Help center
Powered by GitBook
On this page
  • Prerequisites
  • Step 1: Register your application
  • Step 2: Import the Ogury SDK
  • Step 3: Initialize the Ogury SDK
  • Step 4: Integrate Ogury ad formats
  • Before going live

Was this helpful?

Getting started

Last updated 6 months ago

Was this helpful?

This documentation will guide you through all the steps needed to display Ogury ads on the Android platform.

Prerequisites

  • Minimum API Level: 21 or higher.

  • Target SDK Version: 33 or higher.

  • Kotlin Version: 1.8.20 or higher.

  • Required Permissions:

    • android.permission.INTERNET

    • android.permission.ACCESS_NETWORK_STATE

Step 1: Register your application

  • .

  • and .

The asset key follows the format: OGY-XXXXXXXXXXXX, where X represents an uppercase letter or digit. In the code samples provided, we will use the placeholder string OGY-XXXXXXXXXXXX to refer to this asset key.

Step 2: Import the Ogury SDK

To import the latest version of the Ogury SDK into your project:

  • Open the build.gradle of your application.

  • Add the following lines:

repositories {
    maven {
        url 'https://maven.ogury.co'
    }
}

dependencies {
    implementation 'co.ogury:ogury-sdk:6.+'
}

Step 3: Initialize the Ogury SDK

When using a Consent Management Platform (CMP), it is recommended to wait for the CMP to establish the consent status before initializing the Ogury SDK.

When your app is registered and the Ogury SDK is imported, initialize it by calling Ogury.start() before accessing any Ogury SDK functionalities.

Ogury.start(this, "OGY-XXXXXXXXXXXX", object : OguryOnStartListener {
    override fun onStarted() {
        // Initialization successful
    }
    override fun onFailed(error: OguryError) {
        // Handle initialization failure
    }
})
Ogury.start(this, "OGY-XXXXXXXXXXXX", new OguryOnStartListener() {
    @Override
    public void onStarted() {
        // Initialization successful
    }

    @Override
    public void onFailed(OguryError error) {
        // Handle initialization failure
    }
});

The start() method requires two key parameters :

Though optional, the OguryOnStartListener is recommended. It provides callbacks for successful initialization or errors. If initialization fails, the listener returns an OguryError with an error code and message, helping you troubleshoot. The possible errors are defined in the OguryStartErrorCode class for easy reference.

OguryStartErrorCode

Enum value
Description

MODULE_MISSING

The SDK could not be started because a required SDK module is missing.

MODULE_FAILED_TO_START

The SDK could not be started because one of the required SDK modules failed to start.

Step 4: Integrate Ogury ad formats

Ogury offers four distinct ad formats. You can refer to the following sections to proceed with the integration:

Before going live

For details on the latest Ogury SDK release, please refer to the .

the context

the Ogury asset key associated with your app. If you have not an asset key yet, please refer to the to create one.

Ogury is part of the IAB initiative to fight inventory fraud for applications. It is recommended to to include Ogury.

release notes
Application
Interstitial
Rewarded
Small Banner / MREC
Thumbnail
first step
Authorized Sellers for Apps
Log into your Ogury's publisher platform
Register your application
save your asset key
update your app-ads.txt