Tuesday, March 27, 2012

How to put Admob to Air app(Android)


Requirement

  • Air SDK more 3.0
  • Android SDK latest(I check ver15 is ok)
  • Admob publish id

How to create apk file for admob
  • Download "NativeExtensions for AIR" from here. File name is admob_v1.ane.
  • cp "admob_v1.ane" and rename it to "admob_v1.swc".
    • Flash use swc file, but adk use ane file. so need both.
  • Create Air for Android file by Flash CS5.5.
  • Add  admob_v1.swc  to libarary path.
  • Change ringage option from integrated code to external.
  • Once publish to create <app-name>-app.xml
  • Edit  <app-name>-app.xml. Add following yellow line.
    <android> <manifestAdditions> <![CDATA[<manifest> <application> <activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/> </application> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> </manifest>]]> </manifestAdditions> </android> <extensions> <extensionID>com.hdi.nativeExtensions.NativeAds</extensionID> </extensions>
  • Publish to create apk file.
    • Error occur.But it's ok. ignore it.
  • Can't create apk fie by Flash CS5.5
  • use adt Air3 adt tool.
    • following samplecommand
..\Air\AdobeAIRSDK31\bin\adt -package -target apk-captive-runtime -storetype pkcs12 -keystore ".p12 file name" -storepass "p12 password" "created apke file name".apk "app name".xml "app name".swf -extdir .
-extdir : ane file path


Doc
http://lancelotmobile.com/asdocs/native-ads-asdoc/com/hdi/nativeExtensions/NativeAds.html#initAd%28%29


No comments:

Post a Comment