Skip to content

Instantly share code, notes, and snippets.

@revmob-sdk
Created August 13, 2012 17:57
Show Gist options
  • Save revmob-sdk/3342758 to your computer and use it in GitHub Desktop.
Save revmob-sdk/3342758 to your computer and use it in GitHub Desktop.
Adobe Air SDK
package com.revmob.air.sample
{
import com.revmob.airextension.RevMob;
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.system.Capabilities;
public class RevMobExtensionSample extends Sprite
{
// Just replace the ID below with your appID.
private static const ANDROID_APP_ID:String = "4f56aa6e3dc441000e005a20";
// Just replace the ID below with your appID.
private static const IOS_APP_ID:String = "4fd619388d314b0008000213";
public function RevMobExtensionSample()
{
super();
// support autoOrients
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
var appId:String = null;
if ( isIOS() ) {
appId = IOS_APP_ID;
} else if ( isAndroid() ) {
appId = ANDROID_APP_ID;
}
var r:RevMob = new RevMob(appId);
r.showFullscreen();
}
protected static function isIOS():Boolean
{
return Capabilities.os.toLowerCase().indexOf("ip") > -1;
}
protected static function isAndroid():Boolean
{
return Capabilities.os.toLowerCase().indexOf("linux") > -1;
}
}
}
package com.revmob.air.sample
{
import com.revmob.airextension.RevMob;
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.system.Capabilities;
public class RevMobExtensionSample extends Sprite
{
// Just replace the ID below with your appID.
private static const ANDROID_APP_ID:String = "4f56aa6e3dc441000e005a20";
// Just replace the ID below with your appID.
private static const IOS_APP_ID:String = "4fd619388d314b0008000213";
public function RevMobExtensionSample()
{
super();
// support autoOrients
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
var appId:String = null;
if ( isIOS() ) {
appId = IOS_APP_ID;
} else if ( isAndroid() ) {
appId = ANDROID_APP_ID;
}
var r:RevMob = new RevMob(appId);
// Set testing mode. Remove this line before release your app.
r.setTestingMode(true);
r.showFullscreen();
}
protected static function isIOS():Boolean
{
return Capabilities.os.toLowerCase().indexOf("ip") > -1;
}
protected static function isAndroid():Boolean
{
return Capabilities.os.toLowerCase().indexOf("linux") > -1;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment