2016年2月18日星期四

Google Admob Air Native Extension IOS

admob ane for flash air iOS app and actionscript android app.include banner and Interstitial native Advertising.<br/>
this Admob ANE suport admob 1 and admob 2,not using uuid.using the last sdk.
admob ane for air mobile ad ,support Interstitial and Banner<br/>
support  landscape and portrait  and autoOrient<br/>
support ios and android<br/>
support all native event<br/>
support ios 64,air sdk 16 <br/>
support ios 9<br/>
base on admob ios sdk 7.6.0 and admob android sdk(Google Play services 8.1) 8.1<br/>
requred  air sdk 20.0 or later <br/>


very easy to use ,just three line code for simple usage<br/>

### show simple admob banner :
```
var admob:Admob=Admob.getInstance();
admob.setKeys("your admob banner id","your admob institial id");
admob.showBanner(Admob.BANNER,AdmobPosition.BOTTOM_CENTER);
```

###show admob  Interstitial ad (full screen ad)
```
var admob:Admob=Admob.getInstance();
admob.setKeys("your admob banner id","your admob institial id");////replace this fake ID with your really ID
if (admob.isInterstitialReady())// check ad has cached ,if true show it
{
     admob.showInterstitial();
}
else
{
    admob.cacheInterstitial();
}
```
### show test ad banner with extra parameter
```
var extraParam:ExtraParameter=new ExtraParameter();
//extraParam.isChildApp=true;
extraParam.testDeviceID="true";// for android
//extraParam.testDeviceID="your device"; for ios 

var admob:Admob=Admob.getInstance();
admob.setKeys("your admob banner id","your admob institial id");
admob.showBannerAbsolute(Admob.SMART_BANNER,0,100,extraParam);
```
###for android.  you need add in application-app.xml
```
<android>
        <manifestAdditions><![CDATA[
<manifest android:installLocation="auto">
   <uses-permission android:name="android.permission.INTERNET"/>
   <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
   <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
    <application>
 <meta-data android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />
    <activity android:name="com.google.android.gms.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" android:theme="@android:style/Theme.Translucent"/>
    </application>
</manifest>
]]></manifestAdditions>
    </android>
```

**more function**
- 1. handler  ad event  like this.
```
admob.addEventListener(AdmobEvent.onBannerReceive,onAdReceived);
```
- 2. get ad size info
```
protected function onAdReceived(event:AdmobEvent):void
{
    if(event.type==AdmobEvent.onBannerReceive){
trace(event.data.width,event.data.height);
    }
}
```
- 3.get screen size info,old version function
```
admob.getScreenSize()

```
project home:https://github.com/lilili87222/admob-for-flash/ <br />


How To Add Google Admob In Adobe Air Mobile APP

admob ane for flash air iOS app and actionscript android app.include banner and Interstitial native Advertising.
this Admob ANE suport admob 1 and admob 2,not using uuid.using the last sdk.
admob ane for air mobile ad ,support Interstitial and Banner

### init Admob in flash air
```
var admob:Admob=Admob.getInstance();
admob.setKeys("your admob banner id","your admob institial id");
```

### show simple admob banner in adobe air app
```
admob.showBanner(Admob.BANNER,AdmobPosition.BOTTOM_CENTER);
```

###show admob  Interstitial ad (full screen ad)
```
if (admob.isInterstitialReady())// check ad has cached ,if true show it
{
     admob.showInterstitial();
}
else
{
    admob.cacheInterstitial();
}
```
### add admob activity and permission .  you need add in application-app.xml for air android app
```
<android>
        <manifestAdditions><![CDATA[
<manifest android:installLocation="auto">
   <uses-permission android:name="android.permission.INTERNET"/>
   <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
   <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
    <application>
 <meta-data android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />
    <activity android:name="com.google.android.gms.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" android:theme="@android:style/Theme.Translucent"/>
    </application>
</manifest>
]]></manifestAdditions>
    </android>
```

**more function**
- 1. handler  ad event  like this.
```
admob.addEventListener(AdmobEvent.onBannerReceive,onAdReceived);

protected function onAdReceived(event:AdmobEvent):void
{
    if(event.type==AdmobEvent.onBannerReceive){
trace(event.data.width,event.data.height);
    }
}
```
- 3.get screen size info,old version function
```
admob.getScreenSize()

```
download url https://github.com/lilili87222/admob-for-flash/ 


How to Setup Admob with Adobe AIR for Android

How to Setup Admob with Adobe AIR for Android
------
If you are Finished a Project and put it on the Google Play Store. If you  created the Application Using Adobe Flash CS6 and Flash Develop AS3.
If you want to put Ads on your game using Admob but can't seem to do it to save the life of me. then this can help you .

1.first you need download adobe air sdk 20 or later,and upgrade your ide air sdk,then download admob plugin for adobe flash air from https://github.com/lilili87222/admob-for-flash/
2. add adobe air admob plugin to your mobile project ,it ease in flash cc ,flash builder or flash developer.
3.then you can call admob api with as3,the following is same sample code


init Admob in flash air,this need call before call other api,banner id and institial id can got from admob
```
var admob:Admob=Admob.getInstance();
admob.setKeys("your admob banner id","your admob institial id");
```

### show simple admob banner in adobe air app
```
admob.showBanner(Admob.BANNER,AdmobPosition.BOTTOM_CENTER);
```

###show admob  Interstitial ad (full screen ad)
```
if (admob.isInterstitialReady())// check ad has cached ,if true show it
{
     admob.showInterstitial();
}
else
{
    admob.cacheInterstitial();
}
```
### add admob activity and permission .  you need add in application-app.xml ,remember this is reqired for air android app
```
<android>
        <manifestAdditions><![CDATA[
<manifest android:installLocation="auto">
   <uses-permission android:name="android.permission.INTERNET"/>
   <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
   <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
    <application>
 <meta-data android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />
    <activity android:name="com.google.android.gms.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" android:theme="@android:style/Theme.Translucent"/>
    </application>
</manifest>
]]></manifestAdditions>
    </android>
```


That is all,is that easy?