473,395 Members | 1,532 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How do i add admob ads in my app ?

14
Steps that I have taken are listed below...

1) I have downloaded "admob for flash air (admob_all_in_one6.6.7.ane) from this link http://fuji.h1de.net/browse.php?u=Oi...zLw%3D%3D&b=13

2) I added this native extension to my flash cs6 project via advanced actionscript 3 settings -> library path tab.

3) Set my flash target to the air 4.0.01390 for android.

4) I wrote a small class to inialize add....
Expand|Select|Wrap|Line Numbers
  1.     package
  2.     {
  3.       import flash.display.Sprite;
  4.  
  5.     import so.cuo.platform.admob.Admob;
  6.     import so.cuo.platform.admob.AdmobEvent;
  7.  
  8.     public class Interstitial extends Sprite
  9.     {
  10.         var admob:Admob= Admob.getInstance();
  11.  
  12.                 public function Interstitial()
  13.         {
  14.            super();
  15.                 }
  16.  
  17.                 public function displayAdd():void
  18.                 {
  19.            if(admob.supportDevice)
  20.                    {
  21.                         // i have replaced setKeys with my admob ad unit id "ca-app-pub-xxxxxxxxxxx/xxxxxxxxxxx"
  22.                    admob.setKeys("a152834c8723912"); 
  23.  
  24.                            admob.addEventListener(AdmobEvent.onInterstitialReceive,onAdReceived);
  25.                 admob.cacheInterstitial();
  26.            }
  27.         }
  28.  
  29.         protected function onAdReceived(event:AdmobEvent):void
  30.         {
  31.             if(event.type==AdmobEvent.onInterstitialReceive){
  32.                 admob.showInterstitial();
  33.             }
  34.         }
  35.     }
  36.  
5) In my main.as class I am calling the displayadd() method like this...
Expand|Select|Wrap|Line Numbers
  1.     var showAdd:Interstitial = new Interstitial();
  2.     showAdd.displayAdd();
  3.  
6) I have added this code to myappname-app.xml
Expand|Select|Wrap|Line Numbers
  1.     <android>
  2.         <manifestAdditions>
  3.            <![CDATA[<manifest>
  4.                <uses-permission android:name="android.permission.INTERNET"/>
  5.                <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
  6.            <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
  7.                   <application>
  8.              <activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/> 
  9.              </application>
  10.            </manifest>]]>
  11.         </manifestAdditions>
  12.     </android>
  13.  
  14.     <extensions>
  15.         <extensionID>so.cuo.platform.admob</extensionID>
  16.      </extensions>
  17.  
7) published app to my new samsung that uses andriod version 4.2.2

8) no ads display, my app just crashes and de-activates when i call
Expand|Select|Wrap|Line Numbers
  1. var showAdd:Interstitial = new Interstitial();
  2.     showAdd.displayAdd();  
  3.  
have i missed something ?
Feb 22 '14 #1
0 6518

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: luke | last post by:
I am using as3 and flash cs6, I have loaded my admob ad in my constructer and then set the ad visibility to false. Then my game is played ( I have added dynamic movieclips etc filling the page ),...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.