Adobe Animate CC : How to integrate Admob Interstitial for Android
Test on:
- Mac OS X : El Capitan
- Adobe Animate CC (Flash Pro)
- Asus Zenfone 4.5
- ANEAdMob
[Sample Source code & Apk file]
Apk file:
Source code:
This topic not discuss about how to install any application, I just want to show you only apart of Adobe AIR - AdMob Integration for Android, If you want to see more on something else, please tell me at the end of this topic.
[Pre-Require]
download and install from any their instructions.
- Adobe Animate CC (Adobe AIR 20.0 for Android included)
http://www.adobe.com
- ANEAdMob
https://github.com/pozirk/ANEAdMob
[Create Adobe AIR Application]
1. Open Adobe Flash and choose "AIR for Android"
4. In "Publish" panel click an icon "pencil" then type name "Main" and leave button as "Flash Professional" and click ok.
2. Add swc file by click on red-f icon and browse.. to ANEAdMob/air/AdMob/bin/AdMob.swc
3. Add ane by click add path [+] icon then click ane icon, after that browse.. to ANEAdMob/AdMob.ane
<android>
<manifestAdditions><![CDATA[<manifest>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <application>
<meta-data android:name="com.google.android.gms.version" android:value="4323000" />
<!-- should be 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"/>
</application>
</manifest>]]></manifestAdditions>
</android>
and
<extensions>
<extensionID>com.pozirk.ads.AdMob</extensionID>
</extensions>
Sample image:
[Sample Source code & Apk file]
Apk file:
Source code:
It's work!! ;)
----------------------------->>
Learn more about ANEAdMob: https://github.com/pozirk/ANEAdMob
Test on:
- Mac OS X : El Capitan
- Adobe Animate CC (Flash Pro)
- Asus Zenfone 4.5
- ANEAdMob
[Pre-Require]
download and install from any their instructions.
- Adobe Animate CC (Adobe AIR 20.0 for Android included)
http://www.adobe.com
- ANEAdMob
https://github.com/pozirk/ANEAdMob
[Create Adobe AIR Application]
1. Open Adobe Flash and choose "AIR for Android"
2. Then press "command + s", and browse to folder you want to save this project.
sample: "AnCCBannerAds.fla" then I just add text for test when app running on screen and create dynamic text then leave name as "res".
4. In "Publish" panel click an icon "pencil" then type name "Main" and leave button as "Flash Professional" and click ok.
5. An ActionScript was created as below.
6. Add line of code as below images step by step.
6.1 import library.
6.2 implement admob instance
6.3 add listener for admob instance
6.4 create function for any event listener.
7. Add last line of code for show banner, change "ca-app-pub-xxxx" to your admob banner id.
7.1 show banner
Add onCacheEvent function after onEvent function, this function will trigger receive only on cache success, then add call admob interstitial will be show here.
7.2 add onCacheEvent function and call show admob interstitial
Modified addListener of "INTERSTITIAL_SHOW_OK" on "onEvent" change to "onCacheEvent". After that press "command + s", and browse to folder of this project to save Main.as file.
7.3 change "onEvent" to be "onCacheEvent"
[Add ANEAdMob]
1. Extract ANEAdMob.zip then in flash goto File > ActionScript Settings...
2.1 Browse... to .swc file
2.2 result after set library path to .swc file
3.1 Browse... to .ane file
3.2 result after set library path to .ane file
4. Click ok, now you already to setting application for publish.
[AIR Android Settings]
1. In flash goto File > AIR XX.X.X for Android Settings...
2. On General tab check any value as below. don't forget App ID not allow underscore (_) in name just remove it, Version label only for test you can leave it blank. You should see AdMob.ane in Included files.
3. Just skip Deployment and goto tab "Icons" add at least one icon size, i created simple icon rectangle size 72x72 pixels for test.
4. Goto tab "Permissions" and check on "Manually manage permissions...descriptor file."
[Config Application-app.xml]
Open your "filename-app.xml" and paste this code after end of "</icon>" as below images and saved overwrite this files.<android>
<manifestAdditions><![CDATA[<manifest>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <application>
<meta-data android:name="com.google.android.gms.version" android:value="4323000" />
<!-- should be 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"/>
</application>
</manifest>]]></manifestAdditions>
</android>
and
<extensions>
<extensionID>com.pozirk.ads.AdMob</extensionID>
</extensions>
Sample image:
[Publish to Android Device]
1. Goto tab "Deployment" and click "create" if you don't have filename.p12 file, fill any text field with your data, i'm just input sample data then click "Save as" to your project folder.
1.1 Click create... to create certificate file.
1.2 Fill your information
1.3 Choose "save as" to where you want to save certificate file.
1.4 Success create new certificate file.
2. After saved p12 file, fill in "Password" field and check setting as below image.
3. Connect your android device via usb cable. and click "Publish"
4. When your app has success installed on device, you should see this notice.
5. Let's see on your android device and don't forget to turn on your internet connection, AdMob banner was shows up on bottom of screen.
----------------------------->>
Learn more about ANEAdMob: https://github.com/pozirk/ANEAdMob































Comments
Post a Comment