flash 加载admob广告ane, andorid和ios2个版本

先申请admob账号

我们申请ADMOB广告帐户,网址http://www.google.cn/ads/admob/,进入帐户,点击站点和应用程序,创建你的应用程序,点击添加网站/应用程,选择应用类型,我们选IPONE应用或android

推荐用 admob_all_in_one.ane, android和ios集合在一起的

sdk最低版本 air sdk 3.5

1、范例:

var admob:Admob=Admob.getInstance();
if (admob.isSupported)
{
        admob.createADView(AdSize.BANNER, "******"); //替换为你的admob应用id。you must replace this id with your admob app id. create a banner ad view.this init the view .you must replace this id with your.
        admob.addToStage(0, 0); // ad to displaylist position 0,0
        admob.load(false); // send a ad request.  
}
2、如果是android,则需要加上这段配置文件
<manifest android:installLocation="auto">
     <uses-sdk android:targetSdkVersion="11"/>
     <uses-sdk android:minSdkVersion="8"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <application>
         <activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/> 
    </application>
</manifest>
3、配置文件里添加
<extensions> <extensionID>so.cuo.ane.Admob</extensionID> </extensions>

http://code.google.com/p/flash-air-admob-ane-for-ios/

下载: http://code.google.com/p/flash-air-admob-ane-for-ios/downloads/list

Comments are closed.