Higgey
buzztouch Evangelist
Profile
Posts: 392
Reg: Sep 07, 2011
West Midlands
13,520
10/16/13 06:19 AM (10 years ago)

Admob Interstitial Ads and Airpush Ads

Hi, I am trying to learn how to integrate Admob Interstitial Ads and also Airpush Ads. I have had a very good look around the forum for tutorials and also on the net but I am making slow progress. I will continue to try to research this myself but I would be grateful if anybody is able to help me to understand how to integrate these adverts into android apps. Many thanks.
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
11/12/13 07:04 PM (10 years ago)
Hi Higgey, So your trying to integrate ads then? Have you done this yet or still need help? David https://buzztouchmods.com/market
 
Higgey
buzztouch Evangelist
Profile
Posts: 392
Reg: Sep 07, 2011
West Midlands
13,520
like
11/13/13 01:43 AM (10 years ago)
Hi David, Thanks for your response. I'm stuck integrating both airpush and admob interstitial ads and I would very much like some help, please. Admob interstitials would be my preference for now. John
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
11/13/13 11:15 AM (10 years ago)
Okay, let me load up a dummy Android app and try it out myself. Assuming you have the new core android project right? Are you self hosted? David https://buzztouchmods.com/market
 
Higgey
buzztouch Evangelist
Profile
Posts: 392
Reg: Sep 07, 2011
West Midlands
13,520
like
11/13/13 01:03 PM (10 years ago)
That would be great,thanks. I am self hosted running v2.1.9 John.
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
11/13/13 03:42 PM (10 years ago)
Awesome, when you compile do you choose the regular android core or 3.0 core? David https://buzztouchmods.com/market
 
Higgey
buzztouch Evangelist
Profile
Posts: 392
Reg: Sep 07, 2011
West Midlands
13,520
like
11/14/13 06:09 AM (10 years ago)
Hi, I've been using regular android core until now. John.
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
11/14/13 10:12 AM (10 years ago)
I would recommend using the new core, my entire enviroment is srt up for it, and its best we do it with the latest code. David https://buzztouchmods.com/market
 
Higgey
buzztouch Evangelist
Profile
Posts: 392
Reg: Sep 07, 2011
West Midlands
13,520
like
11/14/13 12:55 PM (10 years ago)
No problem, David. I'll sort out using the new code - this will give the impetus to do so! John
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
11/14/13 01:48 PM (10 years ago)
Cool! Let me know how it goes and if you need any help. David https://buzztouchmods.com/market
 
Higgey
buzztouch Evangelist
Profile
Posts: 392
Reg: Sep 07, 2011
West Midlands
13,520
like
12/18/13 09:11 AM (10 years ago)
I've just successfully downloaded an app using android 3.0 so it would be great if we could work on integrating admob intestitials. As a forewarning, I did have a chat with a developer and I understand it isn't easy! John
 
Sandeep
Android Fan
Profile
Posts: 1260
Reg: Feb 01, 2012
Miraj, India
25,250
like
01/09/14 12:02 AM (10 years ago)
Hi John, I have admob interstitial ads working on the old 2.0 android core. No luck yet with the new core 3.0. If you want the codes i can give it to you. And one more thing, we still have legendary admob here so the codes are for old admob 6.4.1. But i am sure the new admob too has similar code give or take few changes in it.
 
Higgey
buzztouch Evangelist
Profile
Posts: 392
Reg: Sep 07, 2011
West Midlands
13,520
like
01/09/14 02:45 AM (10 years ago)
Hi Sandeep, That would be absolutely fantastic. Do you want to put the code here or shall I drop you a PM with my details? Kind regards, John
 
Sandeep
Android Fan
Profile
Posts: 1260
Reg: Feb 01, 2012
Miraj, India
25,250
like
01/09/14 04:38 AM (10 years ago)
Ok John, I used the admob interstitial ads in the splash screen. You need to put the following codes in the BT_screen_splash.java file. 1. First you need to import the interstitial admob ads code somewhere below other imports about below line 50 import com.google.ads.InterstitialAd; 2. put following code in line no 54 or something- public class BT_screen_splash extends BT_activity_base implements AdListener{ the original code is like below, you need to replace it with the above code- public class BT_screen_splash extends BT_activity_base{ just below that line put the following code- private InterstitialAd interstitial; Remember you might get an error on the BT_screen_splash. You need to hover your mouse on that red underlined error, your eclipse will then show you some options. Click on the - Add unimplemented methods. This will add some additional methods at the end of your java file. We will come back to it in the last step. 3. Now the next step is to start the ad request in the onCreate method. The onCreate method starts in the line 64 or something. Scroll to the end of the onCreate method (just above the onResume method). In line 89 or something you will find the following code- //add the view to the base view... baseView.addView(thisScreensView); Just below this code put following code also remember to replace your admob app id with the MY_INTERSTITIAL_UNIT_ID. Keep the "". interstitial = new InterstitialAd(this, "MY_INTERSTITIAL_UNIT_ID"); AdRequest adRequest = new AdRequest(); interstitial.loadAd(adRequest); interstitial.setAdListener(this); 4. Now we need to put the last bit of code in the autogenerated method which i explained in the step 2. Scroll at the bottom of your java file. In line 245 or something you will find a new method which was created automatically. The name is onReceiveAd. This will look like below - @Override public void onReceiveAd(Ad arg0) { // TODO Auto-generated method stub } } You need to replace it with below code- public void onReceiveAd(Ad ad) { Log.d("OK", "Received ad"); if (ad == interstitial) { interstitial.show(); } } } Tell me how it goes with you. You can put this code in any other plugin java file in core 2.0 android. Just check that you put the code in step 3 in right place (mostly at the bottom of onCreate method).
 
Sandeep
Android Fan
Profile
Posts: 1260
Reg: Feb 01, 2012
Miraj, India
25,250
like
01/09/14 04:40 AM (10 years ago)
Also it implies that you have followed all other steps relating to adding the jar file in libs folder, build configuring the jar file, setting your project atleast to Google API Level 13 and declaring the admob activity in your manifest file.
 
Higgey
buzztouch Evangelist
Profile
Posts: 392
Reg: Sep 07, 2011
West Midlands
13,520
like
01/09/14 05:16 AM (10 years ago)
Magic, Sandeep! Would I be right to use the following code to declare th e admob activity in manifest file: <activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
 
Sandeep
Android Fan
Profile
Posts: 1260
Reg: Feb 01, 2012
Miraj, India
25,250
like
01/09/14 05:17 AM (10 years ago)
Yup, you are correct.
 
Higgey
buzztouch Evangelist
Profile
Posts: 392
Reg: Sep 07, 2011
West Midlands
13,520
like
01/09/14 05:31 AM (10 years ago)
Thanks. I'll give this a go and let you know how I get on.
 
Prince apps
Aspiring developer
Profile
Posts: 121
Reg: Nov 23, 2012
Mumbai
1,210
like
05/15/14 11:57 AM (9 years ago)
@Sandeep your method is not working for interstitial ads anymore with google play services. can you please help me with it buddy? :)
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.