Knowledge Base/Publisher & Developer Help/API, SDK & 3rd party Plugins Integration Help

Adobe Air Plugin

Si Bui
posted this on September 25, 2012 02:27 PM

TapIt AIR Native Extension Plugin

Download Tapit Adobe Air Plugin Here

Adobe Air Test APK

Introduction

This is an Air Native Extension (ane) built for TapIt.

AIR Native Extension Installation

Create an AIR mobile project for Android.

Create new AIR mobile project

Add the TapItAir.ane to your project build path.

Create new AIR mobile project

For example: project - properties - build path - Native Extensions

The TapItAir native extension requires these permissions and a TapIt Android Activity to run:

  • android.permission.INTERNET
  • android.permission.ACCESS_NETWORK_STATE
  • android.permission.READ_PHONE_STATE

Create new AIR mobile project

The permisions and Activity must be located in the android manifest for the AIR application.

The Andorid manifest is loacted in your project -app.xml:

<android> <manifestAdditions> <manifest> </manifest> </manifestAdditions> </android> 

within the manifest tags add:

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

and the activity:

<application> <activity android:name="com.tapit.adview.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation"/> </application> 

To finally appear as:

<android> <colorDepth>16bit</colorDepth> <manifestAdditions><![CDATA[ <manifest android:installLocation="auto"> <uses-permission android:name="android.permission.INTERNET"></uses-permission> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission> <uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission> <application> <activity android:name="com.tapit.adview.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation"/> </application> </manifest> ]]></manifestAdditions> </android> 

ActionScript Usage

There can only be one instance of any of the availble ad options.

You can add 1 banner, 1 ad alert and 1 full screen add-- at the same time, but you are unable to add multiple instances of any ad option.
i.e.-- not 2+ banners, 2+ ad alerts, or 2+ fullscreen ads.

Banner example:

package { import flash.display.Sprite; import com.tapit.air.TapItAir; public class MyTapItApp extends Sprite { public function MyTapItApp() { TapItAir.addBanner(); } } } 

Removing Banner example:

package { import flash.display.Sprite; import com.tapit.air.TapItAir; public class MyTapItApp extends Sprite { public function MyTapItApp() { TapItAir.removeBanner(); } } } 

Example for Banner sizing, position and zone:

package { import flash.display.Sprite; import com.tapit.air.TapItAir; import com.tapit.air.BannerSizes; public class MyTapItApp extends Sprite { public function MyTapItApp() { TapItAir.addBanner(BannerSizes.IPHONE_BANNER, "top", "7979"); // size 320 x 50; posistion on top; publisher zone = 7979. //TapItAir.addBanner(BannerSizes.AUTOSIZE_AD, "bottom", "7979"); // default } } } 

Banner size options:

  • BannerSizes.AUTOSIZE_AD = auto
  • BannerSizes.IPHONE_BANNER = 320 x 50
  • BannerSizes.XL_BANNER = 300x50
  • BannerSizes.LARGE_BANNER = 216x36
  • BannerSizes.MEDIUM_BANNER = 168x28
  • BannerSizes.SMALL_BANNER = 120x20

Ad Alert example:

package { import flash.display.Sprite; import com.tapit.air.TapItAir; public class MyTapItApp extends Sprite { public function MyTapItApp() { TapItAir.addAlert(); // To change publisher zone -- TapItAir.addAlert("7984"); } } } 

FullScreen Ad example:

package { import flash.display.Sprite; import com.tapit.air.TapItAir; import com.tapit.air.BannerSizes; public class MyTapItApp extends Sprite { public function MyTapItApp() { TapItAir.addFullScreen(); // To change publisher zone -- TapItAir.addFullScreen("7979"); } } } 

Receiving call back example:

package { import flash.display.Sprite; import flash.events.StatusEvent; import com.tapit.air.TapItAir; public class MyTapItApp extends Sprite { public function MyTapItApp() { TapItAir.addEventListener(StatusEvent.STATUS, statusUpdate); TapItAir.addBanner(); } private function statusUpdate(event:StatusEvent):void { if(event.code=="BANNER_ADDED") { // do something; } if(event.code=="BANNER_CLOSED") { // do something; } } } } 

Call back available codes:

  • BANNER_ADDED
  • BANNER_CLOSED
  • BANNER_ERROR
  • BANNER_CLICKED
  • BANNER_START_FULLSCREEN
  • BANNER_ADDED_FULLSCREEN
  • BANNER_DISMISS_FULLSCREEN
  • ALERT_ADDED
  • ALERT_CLOSED
  • ALERT_ERROR
  • FULLSCREEN_START
  • FULLSCREEN_LOADING
  • FULLSCREEN_READY
  • FULLSCREEN_ADDED
  • FULLSCREEN_ERROR
  • FULLSCREEN_CLICKED
  • FULLSCREEN_DISMISSED
  • FULLSCREEN_CLOSED

 

Video Tutorial


http://www.youtube.com/watch?v=VXq55cxTQp8&feature=g-all-u

 

Comments

User photo
Nacho Avila

Hello,

Do we have to use Flash Builder in order to use your ANE, or will it work in Flash CS6? We're trying to get it to work on CS6 but have not managed to yet. Please advise!

October 02, 2013 09:00 AM
User photo
Nacho Avila

I'm surprised that this is the only post regarding your Adobe AIR Native Extension and that there are no comments apart from mine. Is anybody using this extension? We've given up trying to get ads to display with your ANE in CS6 and we're going to buy Milkman Games' Admob ANE. They replied to our questions in only a couple of hours.

October 04, 2013 01:34 AM
User photo
Si Bui
TapIt

Hello Nacho,

Here is a Video tutorial. Let me know if this works for you. Our adobe was release co-currently with CS6.

http://www.youtube.com/watch?v=VXq55cxTQp8

If you are still having issue, please send screenshot and error log to support@tapit.com.

 

Thanks,

 

Si

October 04, 2013 10:03 AM