Code Monkey home page Code Monkey logo

as3-air-ad-network-framework's Introduction

as3-air-ad-network-framework

project home:https://github.com/lilili87222/as3-air-ad-network-framework
adwhirl for actionscript ?yes ,it do as adwhirl,but more simple and not need server
with this lib, flash developer will been able to add a variety of ad networks advertising in mobile applications quickly and easily,
manage,switching and set rate of each advertising platform no more than 10 line actionscript code
Library comes with support for admob ( ios, android), inmobi (ios, android), chartboost (ios, android), iad (ios) 4 ad platforms now
air Developers can choose any numbers of platform used in a mobile application, or write your own advertising platform plugin extension
#Usage

1.download

compiled platforms.swc or checkout the source, add to flash to flex mobile project project path

2.Use the built-in support for the platform

download the corresponding platforms ane, and add it to flash native extension library path. following admob and inmobi to use in an application as an example

  • config ad platforms you would like to add in air application , AdItem(platform ,rate , appid, signKey,maxInterstitialShowChount) (admob recommended no more than 5 )
var list: Vector <AdItem> = new Vector <AdItem> ();
list.push (new AdItem (new AdmobAdapter (), 10, "admob app id", "", 5));
list.push (new AdItem (new InmobiAdapter (), 10, "inmobi app id"));
AdManager.getInstance () configPlatforms (list);
  • show Interstitial , showInterstitialOrCache() will detects weather already loaded success, if loaded success will show it ,else loaded automatically ,wait for the next calling,If loading fails , it will automatically switch to the next platform to try to load.
AdManager.getInstance().showInterstitialOrCache();
  • display banner ads , banner ads can displayed by setting an absolute position , if advertising fails to load , it will automatically try the next platform .
AdManager.getInstance().showBannerAbsolute(AdSize.PHONE_PORTRAIT, x, y);
  • can also set a relative position , it convenientable for android .
AdManager.getInstance () showBanner (AdSize.PHONE_PORTRAIT,AdPosition.BOTTOM_CENTER);
  • if you use banner in applications , you must tested each banner platform, because a slight difference between the various platforms , such iad banner is 66 pixel height , admob is 50 pixels height.
  • for more function such as events, show ,hidden , support detect you can ref to demo project code

###3.write your own extensions if you do not use the built-in extensions , check out the source code , and then create a adapter for your own extension,??According to support Banner, Interstitial, or MorePage, to impliments the corresponding interface IBanner, IInterstitial or IMorePage. Implementation of specific interfaces can refer AdmobAdapter.as source
###4.android permission to use this in android air application need to configure the network permission in the xxx-app.xml

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

##Supported Platforms ###admob

  • Download : https://github.com/lilili87222/admob-for-flash
  • Supported Platforms : ios, android
  • Supported types of ads : Banner, Interstitial
  • ExtensionID: so.cuo.platform.admob
  • Other notes : android need to add the corresponding activity
<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"/>

###inmobi

<activity android:name="com.inmobi.androidsdk.IMBrowserActivity" android:configChanges="keyboardHidden|orientation|keyboard|smallestScreenSize|screenSize" android:hardwareAccelerated="true" /><br/>

###chartboost

###IAd

###baidu

	<uses-permission android:name="android.permission.INTERNET"/>
        <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
        <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
        <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
        <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
        <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
 	<application>
        <meta-data android:name="BaiduMobAd_APP_ID" android:value="debug" /> 
        <meta-data android:name="BaiduMobAd_APP_SEC" android:value="debug" />
         <activity android:name="com.baidu.mobads.AppActivity" android:configChanges="keyboard|keyboardHidden|orientation"/> 
        </application>

if user like this lib,you can download and review our game
https://itunes.apple.com/us/artist/phonegame/id553087275?mt=8
donate and download more ane
http://www.cuo.so/ane-list/index.html

as3-air-ad-network-framework's People

Contributors

lilili87222 avatar

Watchers

James Cloos avatar Wu Vincent avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.