This page will show you how to integrate Leadbolt Video and Interstitial ads in your Android app using Flash ANE. Download the SDK and sample app. Make sure you can compile the sample app and see test ads.

To get started sign up for a Leadbolt Publisher account here or login to the Publisher Portal here.

gstart


Add your apps

Login to the Publisher Portal and select the ‘Create New App’ button from the “Apps” page. Fill in your app’s details including name and platform. Once app is added, it is recommended that you also apply for our premium deals by clicking “Direct Deals” in the Publisher Portal. Once approved, a “Direct Deals” section should be visible under your app in the Publisher Portal. Use the “Add Section” button if not visible.

 


Copy Your Integration Details

Your integration details will be displayed on the last page of the Create App process. These integration details will be needed when you integrate the Leadbolt SDK into your app.

Create App Dialogue-3


Integrating Leadbolt SDK

Unzip the Leadbolt Adobe Air Extension zip file. This contains a sample flex project and two extension files. Please Note: The plugin has 3 versions depending on the version of Adobe Air SDK you are using in your App. Please select the appropriate version for your App.

If using Flash Professional
To include the Leadbolt extension in your Flash Professional project

1. In Flash professional, set up a new AIR for Android project.

2. Choose “File” -> “Publish settings”.

3. Click the wrench icon next to Script for ActionScript settings.

4. Select the “Library Path” tab, and click “Browse for Native Extension (ANE) File”, and browse to AppTrackerFlexLibrary.ane, then click open. You should now see AppTrackerFlexLibrary.ane listed

If using Flex
To include the Leadbolt extension in your AIR project you need to

1. In Flash Builder, set up a new Flex Mobile Project.

2. In your project’s properties, select “Flex Build Path” section on the left-hand side column, then click the “Native Extensions” tab on the right-hand side, which allows you to target any ANE files that your application needs.

3. Click Add and browse to the AppTrackerFlexLibrary.ane file and then click OPEN.

4. Make sure “Update AIR application descriptor” is ticked, then click OK. You should now see AppTrackerFlexLibrary.ane listed under the Native Extensions tab. Click OK to finish.

5. Go to “Properties” -> “Flex Build Packaging”, select “Google Android” on the left-hand side column, and then click the “Native Extensions” tab. Make sure that the checkbox in the Package column of your native extension is checked. Click Apply.

6. Go to “Properties” -> “Flex Compiler”, then add “-swf-version=29” to “Additional compiler arguments:”

If using FlashDevelop
To include the Leadbolt extension in your FlashDevelop project

1. In FlashDevelop, set up a new project.

2. Copy AppTrackerFlexLibrary.ane file to your project folder.

3. In the explorer panel, right-click the “SWC” and select “Add To Library”

4. Right-click the SWC file in the explorer panel again, select “Options” and then select “External Library”

Once Leadbolt extension has been added to in your IDE, add the following manifest permissions in the project’s app.xml file. Please refer to “SampleApp/src/SampleProject-app.xml” for reference.

Add the Activity definition to the project’s app.xml file under the “manifestAdditions” tag. Please refer to “SampleApp/src/SampleProject-app.xml” for reference.

Add the ID of this extension (com.apptracker.AppTrackerANE) into your -app.xml. Please refer to the end of SampleProject-app.xml in “SampleApp/src” folder for reference. For example:

Using Network Ads and Direct Deals

Once the Leadbolt extension is added and the permissions added to your App, add the following code to your App’s .mxml file. This code uses the Auto recaching option to fetch a new Ad automatically – no additional coding required.

You will need to replace   "YOUR_APP_API_KEY"   with the specific api key for your app (include the double quotes). This is available in the settings menu for your app, under the option “Get App API Key”. To get Direct Deal Ads in your App, click on “Direct Deals” link in the Publisher Portal and click on the Apply button. If your app includes audio or background audio, please ensure you pause audio during ad display.

Passing additional information

You can increase your App’s performance by optionally including the additional information below. This allows selected premium advertisers to display their Ads to your users. To pass this additional information, use the following methods BEFORE calling loadModuleToCache


Using Rewarded Video

To run rewarded video in your App, you will need to apply and be approved. Click on “Rewarded Videos” link in the Publisher Portal to apply or contact your account manager.

When implementing “Rewarded Videos”, please make use of the following code in your App that displays a rewarded video and triggers a client side event listener when the user has watched the video. Check that a “Rewarded Video” section is visible under your app in the Publisher Portal. Use the “Add Section” button if not visible. Contact your account manager if you require a server side postback when the user has watched the video. If your app includes audio or background audio, please ensure you pause audio during ad display.

Please use the following lines of code in your App’s .mxml file. This code uses the Auto recaching option to fetch a new Ad automatically – no additional coding required.

You will need to replace   "YOUR_APP_API_KEY"   with the specific api key for your app (include the double quotes). This is available in the settings menu for your app, under the option “Get App API Key”.

Passing additional information

You can increase your App’s performance by optionally including the additional information below. This allows selected premium advertisers to display their Ads to your users. To pass this additional information, use the following methods BEFORE calling loadModuleToCache


Implementing Event Listeners

With Event Listeners, you can closely follow the ad states throughout your App. Leadbolt SDK will trigger events at all important stages of the Ad life-cycle. To implement event listener, follow the steps outlined below:
Register the event listeners you wish to be notified of, BEFORE you call startSession() and after you call registerEventListeners() :

Now define the following methods in your class, use apptracker.getMessage() to get the additional information with the event:

Passing additional information

You can increase your App’s performance by optionally including the additional information below. This allows selected premium advertisers to display their Ads to your users. To pass this additional information, use the following methods BEFORE calling loadModuleToCache


Troubleshooting

  • Video and Interstitial Ads may not be available at all times in all countries. It is always best to test with your App in Test Mode in the Publisher Portal to ensure as Test Ads are generally always available.
  • You should check your Publisher Portal and ensure the relevant section is visible under your App. Use the “Add Section” button to add if not available.
  • You should check the SDK logs located in Logcat logs with the Tag “AppTracker”.
  • Always test the sample app provided to confirm any integration issues are SDK based.
  • This plugin has been tested on the following versions of Adobe Air: Flash Builder 4.7, Adobe Air SDK version 24

gstart

← Return to Help Center