I have seen a few posts in Buzztouch forums about adding AdMob to the apps for Android created with Buzztouch. I have it mostly figured out and would like to share it with you.
The first thing you want to do is download the Admob sdk from Google. Unzip it and save it in a spot that you will not forget. You will use this library often if you want to put ads in all your apps.
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.
In order for your app to properly maintain the Android activity stack while displaying rich advertising it must instantiate a com.google.ads.AdActivity in its AndroidManifest.xml file.
You need to add these two lines to you manifest files right before the closing application tag.
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation"/>
All Buzztouch apps need the permissions INTERNET and ACCESS_NETWORK_STATE so they should be already enabled. Double check your manifest file to be sure they are.
Here is the tricky part. Since you do not have a main.xml file in your res/layout folder, you need to experiment with the layouts on the individual screens. I am not going to walk you through this part. It really trial and error as to how you make your layout and if it works. I can get it to work on some screens and not on others.
Here is a pic of my act_home.xml file.
Here is a pic of the global_title_dark.xml file.
Make sure you add xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads" to your layout above you ad code as in the top example on this page.
As I said, this is a trial by error method until Buzztouch incorporates ads in their apps.
Here are some screehshots of my app with AdMob ads. I could not get the ads to work with the screens that have the light colored title bar. Most likely an error in the layout on my part. When I get time, I will go back and look at the code to see what I did wrong.
I would have liked the ads to appear at the bottom of the screen but when I tried that, they appeared in the middle of the screen where the list is. Literally on top of the list. That is why I decided to leave them at the top.



You say play around with it. I do have to ask though, I'm having issues with mine in the regard that my home screen is the only one with ads, and the other ones either don't show any or have blank spaces at the top, smushing my content down on itself. Any advice?
ReplyDeleteAdmob does take a while to show ads on all the screens you have ads on. As for the "smushing", do you mean the light-title bar is on top of the list? Or just does not look right? Will add some screenshots above to show how mine looks.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteIt works thank you but there is a black space in the top instead of an ad and i waited for 5 minutes on the app and in the emulator works fine why?
ReplyDeletehey, I did all yoou say on here and it works, but I have a problem, my banner is under the tittle app. For example, my tittle app is world Wear, so my banner is under that, I can see it a little, and people cant push on it, where you put this in your act_home?:
ReplyDeletecom.google.ads.AdView android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adUnitId="your ADMOB ID"
ads:adSize="BANNER"
ads:loadAdOnCreate="true"/>
or what I do? thank you.
Hello, I have tried everything, checked and followed every details, yet I still end up having issues on the main screen:
ReplyDelete"You must have AdActivity declared in AndroidManifest.xml with configChanges "
Yet I have checked/edited/re-checked, edited, AndroidManifest and make sure that I have this declared
Don't know what to do, hope you could help, really appreciate it.
-Hamo
This guide is obsolete. Please refrain from using it as a say-all do-all guide.
ReplyDelete