Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 33    Views: 285

Auggnet
Veteran developer
Profile
Posts: 225
Reg: Nov 20, 2012
USA
2,550
11/21/12 09:57 AM (13 years ago)

Adding Admob to android and IOS

I am trying to figure out how to add admob to android and iOS. Am I supposed to add it into the control panel or in he source code after it is built. Any tutorials that could help would be greatly appreciated.
 
Sandeep
Android Fan
Profile
Posts: 1260
Reg: Feb 01, 2012
Miraj, India
25,250
like
11/21/12 10:29 AM (13 years ago)
Hello Auggnet welcome to bt. I dont know how to integrate admob in ios apps but i do know how to add the admob skd in android apps. I prefer to add admob banner ads in the layout files instead of adding it in the java files. For example if i want to show ads in the custom url screen or html doc screen i put the relevant code in the screen_customurl.xml file or screen_htmldoc.xml files which can be found in the res--->layout folder. The following is the step by step info about adding admob in screen_menulist.xml file. Steps: Step 1. Download the Admob sdk then in eclipse, right click on the project name and select Properties. Select Java Build Path on the left and then make sure the Libraries tab is selected at the top. Then click Add External JARS... on the right side of the window. Navigate to where you saved the unzipped AdMob sdk and select the .jar file. After adding the build path to the sdk, again right click the project file and select properties---> android--- and select Google API 13. If you dont have Google API Level 13, then you will have to download it. Step 2. Add these two lines in AndroidManifest.xml before the closing application tag ..................................................... <activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/> ..................................................... Step 3. Modify your screen_menulist.xml ..................................................... <com.google.ads.AdView android:layout_height="wrap_content" android:id="@+id/adView" android:layout_width="wrap_content" ads:adUnitId="Your ADD MOB ID" ads:adSize="BANNER" ads:loadAdOnCreate="true" android:layout_alignParentBottom="true"> </com.google.ads.AdView> </RelativeLayout> .................................................... Note :- Don't Forget to Add xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads" After <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" .................................................... Screen after adding the above codes looks as follows:- screen_menulist.xml .................................................... <?xml version="1.0" encoding="UTF-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads" android:id="@+id/containerView" android:background="@android:color/transparent" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout android:id="@+id/subContainer" android:layout_height="fill_parent" android:layout_width="fill_parent" android:gravity="center_horizontal" android:orientation="vertical"> <com.google.ads.AdView android:layout_height="wrap_content" android:id="@+id/adView" android:layout_width="wrap_content" ads:adUnitId="Your ADD MOB ID" ads:adSize="BANNER" ads:loadAdOnCreate="true" android:layout_alignParentBottom="true"> </com.google.ads.AdView> <WebView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/webView" android:layout_width="fill_parent" android:layout_height="fill_parent"> </WebView> </LinearLayout> <com.google.ads.AdView android:layout_height="wrap_content" android:id="@+id/adView" android:layout_width="wrap_content" ads:adUnitId="Your ADD MOB ID" ads:adSize="BANNER" ads:loadAdOnCreate="true" android:layout_alignParentBottom="true"> </com.google.ads.AdView> </RelativeLayout>
 
hacerapps
buzztouch Evangelist
Profile
Posts: 542
Reg: Jan 30, 2011
usa
11,170
like
11/21/12 10:44 AM (13 years ago)
admob do not pays good 1 app is making 4 dollars same app with revmob is making from 14 to 20 daily just a tip its up to you i a heard people getting banned for no reason that why i got revmov to lol
 
Sandeep
Android Fan
Profile
Posts: 1260
Reg: Feb 01, 2012
Miraj, India
25,250
like
11/21/12 07:42 PM (13 years ago)
 
hacerapps
buzztouch Evangelist
Profile
Posts: 542
Reg: Jan 30, 2011
usa
11,170
like
11/21/12 11:44 PM (13 years ago)
sandeep do you have the new scringo for android working
 
Sandeep
Android Fan
Profile
Posts: 1260
Reg: Feb 01, 2012
Miraj, India
25,250
like
11/22/12 12:10 AM (13 years ago)
no i have not checked the new scringo sdk for android. i think they have introduced push notifications as well with gcm.
 
Mr stuck
Android Fan
Profile
Posts: 974
Reg: Apr 09, 2012
Fife, Scotland
15,740
like
12/10/12 01:52 PM (13 years ago)
@hacerapps how many clicks per day does it take you to obtain 14 per day with Revmob on android app?
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
12/13/12 02:47 AM (13 years ago)
@Mr stuck .. at Revmob you need installs. If you have a lot of users than it will increase your chances. Android with Revmob isn't the best out there but Revmob overall is pretty good. Chartboost is pretty good in Android and the ads are slick looking :)
 
Mr stuck
Android Fan
Profile
Posts: 974
Reg: Apr 09, 2012
Fife, Scotland
15,740
like
12/13/12 02:57 AM (13 years ago)
@mysps thanks. Will look for a tutorial in the forums to add chartboost.
 
juansezoh
Code is Art
Profile
Posts: 25
Reg: Nov 01, 2012
Medellín
2,200
like
02/05/13 08:59 PM (12 years ago)
I hope someone can help me, I followed the tutorial and a few days ago all was well with admob. Now load the banner in some (very few) times. No that's wrong, it's like not make the request. The 24 hrs palicación is never without requests, that can happen?. Any idea?
 
HelperDev
Lost but trying
Profile
Posts: 49
Reg: Nov 16, 2012
New York
3,090
like
03/08/13 04:59 PM (12 years ago)
This isn't working for me. My app crashes in google api 13 and above... is there a fix?
 
Sandeep
Android Fan
Profile
Posts: 1260
Reg: Feb 01, 2012
Miraj, India
25,250
like
03/08/13 08:03 PM (12 years ago)
@juansezoh- Sorry for late reply but i was out from the forum for some time. Why dont you add newer version sdk of admob in your app and check it? Admob delivers ads almost all the time. My apps send about 10-12,000 ad requests per day and they are filled with the rate of 98-99% , so it should work with you too. @HelperDev- Have you checked the logcat to see what causes the crash? Also on which specific screen you want the ads to show? If you post the logcat errors here it will be a lot helpful to find out whats causing the crash. Google API 13 is the minimum level api to set the admob because admob uses the keyboard hidden orientation. You can also send my your project file to my mail address- sandeepkurne (at) gmail (dot) com. I will be glad to see whats the reason causing the app to crash.
 
Mr stuck
Android Fan
Profile
Posts: 974
Reg: Apr 09, 2012
Fife, Scotland
15,740
like
03/09/13 01:28 AM (12 years ago)
@Sandeep would you be kind enough to help add this to my app also? And startapp as my app crashes after adding startapp code.
 
Sandeep
Android Fan
Profile
Posts: 1260
Reg: Feb 01, 2012
Miraj, India
25,250
like
03/09/13 02:07 AM (12 years ago)
No prob Alan... Just send me your files and app id numbers. I will integrate start app and admob and send you it in couple of hours.
 
Mr stuck
Android Fan
Profile
Posts: 974
Reg: Apr 09, 2012
Fife, Scotland
15,740
like
03/09/13 02:10 AM (12 years ago)
Thanks. I will fire up PC and download fresh copy of code and send it asap.
 
Mr stuck
Android Fan
Profile
Posts: 974
Reg: Apr 09, 2012
Fife, Scotland
15,740
like
03/09/13 03:34 AM (12 years ago)
OK. Sent. Let me know if ad mob id is correct
 
Sandeep
Android Fan
Profile
Posts: 1260
Reg: Feb 01, 2012
Miraj, India
25,250
like
03/09/13 04:36 AM (12 years ago)
Yes the admob id is correct. Will send you the file within few minutes after i implement the codes.
 
Mr stuck
Android Fan
Profile
Posts: 974
Reg: Apr 09, 2012
Fife, Scotland
15,740
like
03/09/13 05:21 AM (12 years ago)
Thanks Sandeep. Look forward to receiving it :)
 
Sandeep
Android Fan
Profile
Posts: 1260
Reg: Feb 01, 2012
Miraj, India
25,250
like
03/09/13 05:26 AM (12 years ago)
Check your mail... :)
 
Mr stuck
Android Fan
Profile
Posts: 974
Reg: Apr 09, 2012
Fife, Scotland
15,740
like
03/09/13 09:04 AM (12 years ago)
Thanks Sandeep. All works fine except menu simple. The items in list disappear and the admob ad appears at top of screen. All other screens show ad at bottom. Also noticed startapp now asks to accept or decline, do you still get paid if user declines?
 
Sandeep
Android Fan
Profile
Posts: 1260
Reg: Feb 01, 2012
Miraj, India
25,250
like
03/09/13 09:53 AM (12 years ago)
I checked the app to find simple menu list but could not find one. So i could not test that plugin. Anyway it is bad idea to post ads on menu list. I avoid it because it gives bad user experience. Yes the startapp has now the users either accept the policy or decline it. If the user declines, then the download is not counted. But the popup dialogue will show each and every time till the user accepts the terms. If your app is good enough then, the user will have to accept it sooner or later.
 
Mr stuck
Android Fan
Profile
Posts: 974
Reg: Apr 09, 2012
Fife, Scotland
15,740
like
03/09/13 09:59 AM (12 years ago)
OK. Do you find most users now decline? Thanks again for your help.
 
Sandeep
Android Fan
Profile
Posts: 1260
Reg: Feb 01, 2012
Miraj, India
25,250
like
03/09/13 10:04 AM (12 years ago)
No... Most of the downloaders accept it. BTW did you try airpush. It is really cool and pays really handsome. My ecpm is about $3.85 this month so far for about 22 apps.
 
Mr stuck
Android Fan
Profile
Posts: 974
Reg: Apr 09, 2012
Fife, Scotland
15,740
like
03/09/13 10:09 AM (12 years ago)
Never looked at air push. Will check it out. Thanks
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
06/27/13 06:52 PM (12 years ago)
does anyone know why I am getting "string types not allowed at configChanges" error when adding the above codes for admob in the manifest
 
bmdubb
Lost but trying
Profile
Posts: 5
Reg: Jan 03, 2013
Baltimore
2,700
like
07/01/13 05:50 PM (12 years ago)
I don't have a screen_menulist.xml I have screen_menulistsimple.xml I followed everything identical and I keep getting the force stop error. I'm using Google 13 api and everything. The app loads and when I click on a menu it crashes. Error - the application "app name"(process com. "app name") has stopped unexpectedly. Ok I have it working. I was using the wrong layout. I used the screen_customurl.xml and it worked. Now another problem. The ad is to the far left and it's showing over top of text instead beneath it. Any way to make it push text up or down? And I remember seeing something about smart_banner or something. Is that what I need to prevent the far left view?
 
Sandeep
Android Fan
Profile
Posts: 1260
Reg: Feb 01, 2012
Miraj, India
25,250
like
07/01/13 07:55 PM (12 years ago)
@bmdubb- The new version of admob has the option to set smart banner ads. Smart banner covers up all the space on the back of the screen which the ad leaves blank. Instead of BANNER you have to put SMART_BANNER to smart banners to show on your layouts. This also looks good on devices with large screen because the left over space is covered with blackish dotted strip. The only solution for your problem of ad banner over lapping your text is to use "enter" key. This way you will be able to leave the lower portion blank and the ads will show up there or else the ads will cover up your texts. @CMCOFFEE- You have to add the following lines in your manifest file and no other code relating to admob. Put the following code before closing the application tag at the bottom of manifest file- <activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
 
bmdubb
Lost but trying
Profile
Posts: 5
Reg: Jan 03, 2013
Baltimore
2,700
like
07/01/13 08:00 PM (12 years ago)
Use "enter" key? I don't understand. This is my screen_customurl.xml..... <?xml version="1.0" encoding="UTF-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads" android:id="@+id/containerView" android:background="@android:color/transparent" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout android:id="@+id/subContainer" android:layout_height="fill_parent" android:layout_width="fill_parent" android:gravity="center_horizontal" android:orientation="vertical"> <WebView android:id="@+id/webView" android:layout_width="fill_parent" android:layout_height="fill_parent"> </WebView> </LinearLayout> <com.google.ads.AdView android:id="@+id/adView" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" ads:adSize="SMART_BANNER" ads:adUnitId="xxxxxxxxxxxxx" ads:loadAdOnCreate="true"> </com.google.ads.AdView> </RelativeLayout>
 
Sandeep
Android Fan
Profile
Posts: 1260
Reg: Feb 01, 2012
Miraj, India
25,250
like
07/01/13 08:59 PM (12 years ago)
This custom url you are using, is this from your own website or you use it from other website? If its your website then, you can modify the html file and use <br> tag at the bottom.
 
bmdubb
Lost but trying
Profile
Posts: 5
Reg: Jan 03, 2013
Baltimore
2,700
like
07/01/13 09:33 PM (12 years ago)
This file was created using buzztouch (res/layout). They were in there already. I edited this particular file so admob would show. I tried some others and couldn't get it to work, like the screen_customhtml, screen_menulistsimple, etc. It's the only one I could get to work with admob. I still don't understand what you mean. I understand <br> but where does it go within the code above?
 
Sandeep
Android Fan
Profile
Posts: 1260
Reg: Feb 01, 2012
Miraj, India
25,250
like
07/01/13 09:51 PM (12 years ago)
Where have you put admob codes, in the custom url or custom html screen?? From the above post with codes you state that you have put the codes in screen_customurl.xml. That code is good to show admob banner ads. Now which url's have you put in your app? For eg. if i want my blog page to appear in the app i would put the url of my blog on the control panel of custom url. In that case, the last few lines of the blog page, i will put the <bt> tag so that there i can have some empty space and the admob banner ads fit in it without over lapping the text on that blog page. In short you will have to edit the html page of the custom url which you refer in the bt cp and not the xml layout file with the <br> tag. Hope you understand what i am trying to tell you here.
 
bmdubb
Lost but trying
Profile
Posts: 5
Reg: Jan 03, 2013
Baltimore
2,700
like
07/01/13 10:06 PM (12 years ago)
Yes the screen_customurl.xml file. One url is to an autoresponder and the other is to a reference link. The whole app is basically text, no pictures. And information app. I don't understand what you mean about a blog page. There's no blog being used. I want to create this an upload it to google play. It's just text. Each title you click on takes you to a screen with the text information. I'm using one www screen (plugin) in the screens menu on BT to connect them to an autoresponder. I noticed that doesn't even show on the home screen. You mean buzztouch control panel or eclipse?
 
Sandeep
Android Fan
Profile
Posts: 1260
Reg: Feb 01, 2012
Miraj, India
25,250
like
07/01/13 10:09 PM (12 years ago)
Ok, the blog thing was just an example. Now that you have used the custom url of the html files which has some text, you have to edit the html files with the <br> tag at the bottom of your text.
 
bmdubb
Lost but trying
Profile
Posts: 5
Reg: Jan 03, 2013
Baltimore
2,700
like
07/02/13 04:48 AM (12 years ago)
How and where do I do that? I'm using Eclipse.
 

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.