Skip to content

Integration

awallace87 edited this page Aug 23, 2016 · 1 revision

Integration

The Yieldmo Android SDK supports Android API Level 16 (Jellybean) and above

Adding the SDK to your project

Maven

In order to integrate the SDK through Maven, include the following in your application's build.gradle script:

dependencies {
  //... your application's dependencies

  //Include the Yieldmo Android SDK
  compile 'ym:ymsdk:4.0.0'

  //Other dependencies that are required by the Yieldmo Android SDK
  compile 'com.google.android.gms:play-services-ads:8.+'
  compile 'com.android.support:appcompat-v7:23.+'
  compile 'com.android.support:recyclerview-v7:23.+'
}

repositories {
  //... your application's maven repositories
  maven {
      url 'https://github.com/yieldmo/maven-repository/raw/master/'
  }
}

Application Manifest

In your application's AndroidManifest.xml file, you need to enable to following permissions for the Yieldmo Android SDK to run properly:

<manifest ...>
  <uses-permission android:name="android.permission.INTERNET"/>
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
  ...
</manifest>

Initialize the SDK

As early as possible in your application's execution (Ideally in the onCreate() override of your application's Launcher Activity), make the following call:

Yieldmo.initialize(YMConstants.appId, this.getApplicationContext());

Note: This code snippet is initializing the SDK with a Test application ID. Please contact your Yieldmo Account Manager, or Yieldmo Support to obtain a proper application ID.

Displaying a Yieldmo Ad

The following code snippet will create a Yieldmo Ad that displays a test Hyperscroller creative:

YMPlacementView.Builder builder = new YMPlacementView.Builder(context);
            builder.placementId(YMConstants.hyperscrollerPlacementId);
            view = builder.build();

Note: This code snippet is creating a Placement View with a Test placement ID. Please contact your Yieldmo Account Manager, or Yieldmo Support to obtain a proper placement ID

Note: All Placement views have layout parameters with no margins or padding. This is meant to provide publishers with as much control as possible when including Yieldmo advertisements in their application's layout. Please ensure that you add the appropriate padding suitable for your app’s design and layout.

Android-SDK-Beta

  • Home
  • [Key Terms](Key Terms)

Start Here


  • [Listening for Ad Events](Listening for Ad Events)
  • Additional Settings
  • [Page View](Page View)
  • [Custom Content Frame](Content Frame)
  • Proguard

Have a previous SDK?

  • [Upgrade Guide](Upgrade Guide)

Clone this wiki locally