Getting started

This guide shows how to include the Instal publisher SDK into your Android application.

Here are the basic integration steps:

  1. configure gradle dependency or download jar
  2. configure Android manifest

Requirements and Dependencies

  • Android 2.3.1 (API Version 9) and up
  • Recommended Google Play Services 5.0.89 and up.

We strongly recommend compiling your app against the Google Play Services Library in order to use the Android Advertising ID instead of the device ID, as required by Google. Failing to correctly use the Android Advertising ID may result in your submission to the Play Store being rejected.

Gradle integration

You build.gradle file needs to be updated in order to configure instal SDK integration. Add the instal maven repository to the repository list:

maven { url 'https://bitbucket.org/tbdsrl/instal-publisher-sdk-releases/raw/master/' }

Add the dependency to the instal sdk jar:

compile 'com.instal:instal-publisher-sdk:1.+'

This is a complete build.gradle file:

apply plugin: 'com.android.application'

repositories {
    maven { url 'https://bitbucket.org/tbdsrl/instal-publisher-sdk-releases/raw/master/' }
}

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        applicationId "com.instal.baseapp"
        minSdkVersion 9
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
        }
    }
}

dependencies {
    compile 'com.google.android.gms:play-services-analytics:7.5.0'
    compile 'com.instal:instal-publisher-sdk:1.+'
}

Eclipse integration

You can download latest version jar from the maven repository:

https://github.com/instal/sdk-repo/tree/master/com/instal/instal-publisher-sdk

Copy the downloaded jar to libs directory inside your app project.

Adding Google Play Services

Follow the instructions on the Android Developer Site for setting up Google Play Services. We recommend always using the latest version of Google Play Services.

Android Manifest

Your AndroidManifest.xml will need to be updated in order to complete the SDK integration. Add the following permissions and activity declarations.

Declare the following permissions:

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

Note: ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION are only needed if you want the device to automatically send the user's location for targeting. WRITE_EXTERNAL_STORAGE is optional and only required for MRAID 2.0 storePicture ads.

Declare the following activities:

<activity
    android:name="com.instal.mobileads.MraidVideoPlayerActivity"
    android:configChanges="keyboardHidden|orientation|screenSize"
    android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<activity
    android:name="com.instal.mobileads.MraidBrowser"
    android:configChanges="keyboardHidden|orientation|screenSize"
    android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<activity
    android:name="com.instal.mobileads.MraidActivity"
    android:configChanges="keyboardHidden|orientation|screenSize"
    android:theme="@android:style/Theme.Translucent.NoTitleBar" />

Add this tag to your to use Google Play Services:

<meta-data android:name="com.google.android.gms.version"
    android:value="@integer/google_play_services_version" />

Displaying Ads

Once you've completed the above steps, you can start displaying ads in your application by following the instructions on the banner, interstitial, featured alert, native or native list pages.