Prince apps
Aspiring developer
Profile
Posts: 121
Reg: Nov 23, 2012
Mumbai
1,210
05/17/14 11:22 AM (10 years ago)

[SOLVED]How to do Integration of Admob ads with Google play services

hi friends. i need help to do Integration of Admob intrestitial ads with Google play services i got Admob banner ads successfully by the help of link below. but do not understanding the guide for interstitial ads and facing errors. <a href="https://www.buzztouch.com/forum/thread.php?tid=64DE8F7C56FC178B149FAFB" target="_blank" rel="nofollow">https://www.buzztouch.com/forum/thread.php?tid=64DE8F7C56FC178B149FAFB</a> is there anybody here who is done with admob interstitial ads? if yes please help me. i got stuck on the same problem from last one week. so help will be really appreciate. i am using both bt 3 and bt2 apps.
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
05/17/14 12:02 PM (10 years ago)
I think kennedyE has.what are your errors?
 
pimentazores
Aspiring developer
Profile
Posts: 47
Reg: Mar 26, 2013
Barcelona
8,020
like
05/17/14 01:43 PM (10 years ago)
Hello, I found the instructions for Bt3 here in the forums sometime ago and save it on my computer. I can't find the original post, so I'll just copy and paste them here: Here is How to Add Admob Interstitial Ads to an Android BT v3 App since its having fragments instead of activities: 1. Add this code to your AndroidManifest before closing application: <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"/> 2. In your java add this code among other imports: import com.google.android.gms.ads.*; 3. In your java add this code in your activity class (the main class that extends Activity): private InterstitialAd interstitial; 4. Still in your java add this code to somewhere in your //onCreateView... : interstitial = new InterstitialAd(getActivity()); interstitial.setAdUnitId("Your_Google_Admob_Ad_ID"); AdRequest adRequest = new AdRequest.Builder().build(); interstitial.loadAd(adRequest); and it should look like this: View thisScreensView = inflater.inflate(R.layout.sw_smugmsgloc, container, false); screenView = thisScreensView; interstitial = new InterstitialAd(getActivity()); interstitial.setAdUnitId("Your_Google_Admob_Ad_ID"); AdRequest adRequest = new AdRequest.Builder().build(); interstitial.loadAd(adRequest); 5. Lastly, in your java add this code to your //onStart, or //onResume, or //onDestroy or just anywhere you want to load the Ads: if (interstitial.isLoaded()) { interstitial.show(); } and it should look like this: //onDestroy @Override public void onDestroy() { ((BT_activity_host)getActivity()).stopListeningForLocationUpdate(); super.onDestroy(); BT_debugger.showIt(fragmentName + ":onDestroy"); if (interstitial.isLoaded()) { interstitial.show(); } } And it's done!
 
KennedyE
Android Fan
Profile
Posts: 373
Reg: Dec 07, 2013
PH, Nigeria
3,730
like
05/17/14 02:12 PM (10 years ago)
@Prince apps, I think maybe you are getting the error because you are trying to add banner and interstitial ads to the same screen. Try adding interstitial ads alone to the screen without banner ads. Note: my above guide is for adding interstitial ads alone to a screen without banner ads, I was working on a solution to help add banner and interstitial ads on the same screen before I decided to stop developing android apps for a while because of lack of android plugins in BT market, I will only be motivated to resume work on that solution again when I begin to see great and polished android plugins in BT market, until then... cheers!
 
Prince apps
Aspiring developer
Profile
Posts: 121
Reg: Nov 23, 2012
Mumbai
1,210
like
05/17/14 08:31 PM (10 years ago)
@Kennedye i'm not trying place it on same screen. i'm trying to place it on bt_screen_menuListsimple.java and on bt_screen_splash.java but it's not working as per guide by @pimentazores and @kennedye and i'm getting something "getActivity" error when i placing following code at //onCreateView... : interstitial = new InterstitialAd(getActivity()); interstitial.setAdUnitId("Your_Google_Admob_Ad_ID"); AdRequest adRequest = new AdRequest.Builder().build(); interstitial.loadAd(adRequest); see the screenshot below to know how i'm getting these error? and tell me what should i need to do now? https://fbcdn-sphotos-b-a.akamaihd.net/hphotos-ak-prn2/t31.0-8/s960x960/10382252_1447381432176602_8480374001286301539_o.jpg
 
Prince apps
Aspiring developer
Profile
Posts: 121
Reg: Nov 23, 2012
Mumbai
1,210
like
05/18/14 07:28 PM (10 years ago)
Nobody is there to answer? :/
 
Prince apps
Aspiring developer
Profile
Posts: 121
Reg: Nov 23, 2012
Mumbai
1,210
like
05/20/14 11:19 AM (10 years ago)
hey guys it's not happening please help me. i seriously need it. :/
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
05/20/14 11:27 AM (10 years ago)
paste your code that you've used and specify where you used it
 
Prince apps
Aspiring developer
Profile
Posts: 121
Reg: Nov 23, 2012
Mumbai
1,210
like
05/24/14 07:20 AM (10 years ago)
please read it @CMCOFFEE @Kennedye i'm not trying place it on same screen. i'm trying to place it on bt_screen_menuListsimple.java and on bt_screen_splash.java but it's not working as per guide by @pimentazores and @kennedye and i'm getting something "getActivity" error when i placing following code at //onCreateView... : interstitial = new InterstitialAd(getActivity()); interstitial.setAdUnitId("Your_Google_Admob_Ad_ID"); AdRequest adRequest = new AdRequest.Builder().build(); interstitial.loadAd(adRequest); see the screenshot below to know how i'm getting these error? and tell me what should i need to do now? https://fbcdn-sphotos-b-a.akamaihd.net/hphotos-ak-prn2/t31.0-8/s960x960/10382252_1447381432176602_8480374001286301539_o.jpg
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
05/24/14 09:16 AM (10 years ago)
You dont have your ad id in there
 
Prince apps
Aspiring developer
Profile
Posts: 121
Reg: Nov 23, 2012
Mumbai
1,210
like
05/24/14 09:33 PM (10 years ago)
it doesn't matter main thing is error of getactivity which is can't resolvable. and that's what the reason i'm stuck on the same issue from half month
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
05/25/14 09:27 PM (10 years ago)
Add that code around line 243, right above: "//return... return thisScreensView;" maybe
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
05/25/14 09:29 PM (10 years ago)
duplicate post
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
05/25/14 09:36 PM (10 years ago)
ok if you look at the link of tutorial of your first post, you will see in that tutorial that you posted code in the wrong place: https://www.buzztouch.com/forum/thread.php?tid=64DE8F7C56FC178B149FAFB
 
Prince apps
Aspiring developer
Profile
Posts: 121
Reg: Nov 23, 2012
Mumbai
1,210
like
05/27/14 11:27 PM (10 years ago)
then where to place the code buddy. tell me exact where i need to place it and in which activity?
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
05/28/14 08:06 AM (10 years ago)
It tells you in that link you posted.clas of whatever screen
 
Prince apps
Aspiring developer
Profile
Posts: 121
Reg: Nov 23, 2012
Mumbai
1,210
like
07/29/14 01:52 AM (10 years ago)
@CMCOffe i am using custom html and custom url screens. now tell me in which java file i need to use this code. :/
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
07/29/14 06:14 AM (10 years ago)
You dont use this code.look at admob docs its easier.put in both custom html and url classes.(java)
 
Prince apps
Aspiring developer
Profile
Posts: 121
Reg: Nov 23, 2012
Mumbai
1,210
like
07/29/14 09:21 PM (10 years ago)
i got this code AdView adView = (AdView)this.findViewById(R.id.adView); AdRequest adRequest = new AdRequest.Builder() .addTestDevice(AdRequest.DEVICE_ID_EMULATOR) .addTestDevice("TEST_DEVICE_ID") .build(); adView.loadAd(adRequest); but my problem is where to put it in my custom html and custom url java files? do you know exactly where to put this code man?
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
07/30/14 08:11 AM (10 years ago)
In oncreateview method
 
Prince apps
Aspiring developer
Profile
Posts: 121
Reg: Nov 23, 2012
Mumbai
1,210
like
07/30/14 10:09 PM (10 years ago)
it's not working see following image i'm getting this error while putting code at where you said. https://fbcdn-sphotos-c-a.akamaihd.net/hphotos-ak-xpa1/t31.0-8/p526x395/10560512_1475713556010056_2971734744095614997_o.jpg now what? help me
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
07/31/14 08:10 AM (10 years ago)
Look at pimentazores post above.shows you where to put it
 
Prince apps
Aspiring developer
Profile
Posts: 121
Reg: Nov 23, 2012
Mumbai
1,210
like
08/02/14 01:03 AM (10 years ago)
i posted on what he said and now there is no errors at all but ads are not coming. that means it's not right code. we must place AdView adView = (AdView)this.findViewById(R.id.adView); to load ads and as you can see in screenshot i have sent in earlier comment it's not working for me asking to create activity for findviewbyId. help me what to do now? i am really stuck on the problem from last one month you can say. help me please. i will be so thankful to you
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
08/02/14 01:09 AM (10 years ago)
did you use this code? https://developers.google.com/mobile-ads-sdk/docs/admob/advanced its just a few changes but mostly the same.pm me your project and ill take a look.if you want
 
Prince apps
Aspiring developer
Profile
Posts: 121
Reg: Nov 23, 2012
Mumbai
1,210
like
08/02/14 01:27 AM (10 years ago)
yes but not working for bt apps. i think no one can help me about how can i use admob with this all new bt apps. if you can able to help me please help me. i can come online to team viewer if you want
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
08/02/14 01:41 AM (10 years ago)
Thats becaude buzztouch is mor up to date and uses fragments instead of old activities lol.yes ill do a teamviewervsession tomorrow.I have to sleep now.work soon.ill pm you when im off or send me a message on here
 
pimentazores
Aspiring developer
Profile
Posts: 47
Reg: Mar 26, 2013
Barcelona
8,020
like
08/02/14 03:54 AM (10 years ago)
Hi Prince apps, we are talking about interstitials, did you try to ad this code just after: BT_debugger.showIt(fragmentName + ":onCreateView JSON itemId: \"" ....... View thisScreensView = inflater.inflate(R.layout.cr_menu_advanced, container, false); interstitial = new InterstitialAd(getActivity()); interstitial.setAdUnitId("ca-app-pub-xxxxxxxxxxx/xxxxxxxxxx"); AdRequest adRequest = new AdRequest.Builder().build(); interstitial.loadAd(adRequest);
 
pimentazores
Aspiring developer
Profile
Posts: 47
Reg: Mar 26, 2013
Barcelona
8,020
like
08/02/14 03:58 AM (10 years ago)
dont put admob code just after the //onCreateView... @Override then for banner ads please put the code after: thisScreensView = inflater.inflate ........ AdView adView = (AdView) thisScreensView.findViewById(R.id.adView); AdRequest adRequest = new AdRequest.Builder().build(); adView.loadAd(adRequest); and off course add corresponding code to the layout file. If you have any problems doing that please let me know
 
Prince apps
Aspiring developer
Profile
Posts: 121
Reg: Nov 23, 2012
Mumbai
1,210
like
08/02/14 04:05 AM (10 years ago)
here you can see in screenshot i have placed code exactly way you said https://fbcdn-sphotos-h-a.akamaihd.net/hphotos-ak-xfp1/t1.0-9/10352890_708440325889644_6530966817755679938_n.jpg i am using custom html screen in my app so placing this code to bt_screen_customHtml.java moreover screen do not have onstart, onresume and ondestroy to load interstitials ads. please help me buddy. what to do now?
 
Prince apps
Aspiring developer
Profile
Posts: 121
Reg: Nov 23, 2012
Mumbai
1,210
like
08/02/14 04:34 AM (10 years ago)
Hey thanks a lot buddy banner ads are now coming you're genius. both banner ads and intrestitial ads are now coming. you're genius brother. please try to reply on my all thread. thanks thanks thanks a lot.
 
pimentazores
Aspiring developer
Profile
Posts: 47
Reg: Mar 26, 2013
Barcelona
8,020
like
08/02/14 07:22 AM (10 years ago)
Cool, I'm glad it worked. The reward for you persistence! Enjoy it! Cheers
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
08/02/14 09:00 AM (10 years ago)
Congrats!youre the real genius.you figured it out yourself!
 
KennedyE
Android Fan
Profile
Posts: 373
Reg: Dec 07, 2013
PH, Nigeria
3,730
like
08/02/14 01:36 PM (10 years ago)
Now you know my guide links are not dead as you suppose, Lol. My marriage is by the corner: reason why I was not always here, cheers!
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
08/02/14 02:14 PM (10 years ago)
Ha read commentt wrong.pimentazores is a app genius too
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
08/02/14 11:14 PM (10 years ago)
heres how to do interstitials for amazon ads.they payout at 2 bucks and have a guaranteed cpm of $6 for august and september https://www.buzztouch.com/forum/thread.php?fid=CA340F0596E5E5911F45AC4&tid=CA340F0596E5E5911F45AC4
 
Prince apps
Aspiring developer
Profile
Posts: 121
Reg: Nov 23, 2012
Mumbai
1,210
like
08/02/14 11:26 PM (10 years ago)
@KennedyE sorry buddy but whenever i click on your following link it gives me error of invalid request (2) https://www.buzztouch.com/forum/thread.php?tid=64DE8F7C56FC178B149FAFB @CMCOFEE big thanks to you genius. without your continuous efforts of helping me it's never possible. you always there when i need any help so big thanks to you as well. and thanks for integration guide for amazon ads. do you really think it's in complaint with google play privacy policy? because after last updates they are really strict again other ad-networks rather then admob.
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
08/03/14 08:19 AM (10 years ago)
Theyre actially admob ads but just hosted from amazon.I use app lovin mostly for ads for admob is better than applovin.I just havent updated my apps yet
 
KennedyE
Android Fan
Profile
Posts: 373
Reg: Dec 07, 2013
PH, Nigeria
3,730
like
08/29/14 09:24 AM (10 years ago)
I think the problem is from buzztouch, that link was working before...
 
Ivelin
I hate code!
Profile
Posts: 19
Reg: Feb 05, 2014
Alva
190
like
09/08/14 09:13 PM (10 years ago)
I am trying to integrate admob banner ads. Can somebody help since the link does not work anymore. Thank you for your time
 
Ivelin
I hate code!
Profile
Posts: 19
Reg: Feb 05, 2014
Alva
190
like
09/08/14 09:54 PM (10 years ago)
I figured it out. I had to create a new ad id and it worked fine. Thank you for the great thread. You guys are the best!!!
 
Silvia SuperStar
Android Fan
Profile
Posts: 54
Reg: Feb 06, 2014
Ibiza
540
like
10/15/14 06:09 PM (9 years ago)
Followed all the steps but not working for me. I am trying to put interstitials on bt custom html but there is not onstart, onresume or ondestroy. Where i must put this code? if (interstitial.isLoaded()) { interstitial.show(); }
 
Silvia SuperStar
Android Fan
Profile
Posts: 54
Reg: Feb 06, 2014
Ibiza
540
like
10/16/14 11:55 AM (9 years ago)
tried on the quiz plugin (at onstart) and nothing happens
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
10/18/14 01:06 AM (9 years ago)
it takes awhile to load,and make sure you have the right code in the manifest
 
Silvia SuperStar
Android Fan
Profile
Posts: 54
Reg: Feb 06, 2014
Ibiza
540
like
10/18/14 06:45 PM (9 years ago)
I think 2 days is enough for load :) Of course i have the right code in the manifest, followed the guide step by step but not working :-(
 
Silvia SuperStar
Android Fan
Profile
Posts: 54
Reg: Feb 06, 2014
Ibiza
540
like
10/18/14 07:01 PM (9 years ago)
On the quiz i had success launching interstitial but at the end of the quiz //shows finished options... public void showFinishedOptions(){ BT_debugger.showIt(fragmentName + ":showFinishedOptions"); if (interstitial.isLoaded()) { interstitial.show(); } But on custom html/txt still no success
 
Silvia SuperStar
Android Fan
Profile
Posts: 54
Reg: Feb 06, 2014
Ibiza
540
like
10/18/14 07:06 PM (9 years ago)
Had luck... Here is working: //back button... public void handleBackButton(){ BT_debugger.showIt(fragmentName + ":handleBackButton"); if(webView.canGoBack()){ webView.goBack(); }else{ BT_debugger.showIt(fragmentName + ":handleBackButton cannot go back?"); } if (interstitial.isLoaded()) { interstitial.show(); } }
 
Prince apps
Aspiring developer
Profile
Posts: 121
Reg: Nov 23, 2012
Mumbai
1,210
like
10/19/14 10:28 AM (9 years ago)
You can create yourself on start, on back press or on pause then you can add that loading code there. Just like you made for back button. Make sure you don't put this code on on destroy because it's do not allow on google play store as per all new google play store developer privacy policy.
 

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.