Discussion Forums  >  Uncategorized

Replies: 9    Views: 501

steveh6883
buzztouch Evangelist
Profile
Posts: 383
Reg: May 15, 2011
Gosport, UK
3,830
06/01/11 01:17 AM (14 years ago)

AdMob Ads in v1.4 Android?

Hi All Been trying to implement AdMob ads into v1.4 android according to this guide here: http://androidcookbook.com/Recipe.seam?recipeId=724&recipeFrom=ViewTOC But getting stuck at step 5, not sure which layout file it is referring to Any ideas?
 
Lyle @SFNeNT
buzztouch Evangelist
Profile
Posts: 168
Reg: Apr 29, 2011
Chicago, IL
2,830
like
06/02/11 08:15 AM (14 years ago)
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
06/02/11 11:27 PM (14 years ago)
@ steveh6883: The layout files in the buzztouch v1.4 are different for each type of screen. Have a look in the res/layout folder and you'll see a bunch of them. This means you'll end up putting the stuff explained in step-5 in these files. I would start by trying to add the changes to one of the existing layouts, like maybe the web-view layout? Seems logical that you would get one working before making the changes to the others. I've not done this yet but it doesn't look too tough.
 
Lyle @SFNeNT
buzztouch Evangelist
Profile
Posts: 168
Reg: Apr 29, 2011
Chicago, IL
2,830
like
06/06/11 04:38 PM (14 years ago)
@ Steveh6883 did you have any luck with this...I seem to get a force close error when ever I change any of the layouts
 
steveh6883
buzztouch Evangelist
Profile
Posts: 383
Reg: May 15, 2011
Gosport, UK
3,830
like
06/16/11 05:20 PM (14 years ago)
nope, can't find the right place to put that bit of code - just keep getting 'force close' same as you Now trying something different - airpush - only for android but it puts a notification in the notification tray instead of displaying ads in the app, looks interesting will let you knoiw how it goes
 
Lyle @SFNeNT
buzztouch Evangelist
Profile
Posts: 168
Reg: Apr 29, 2011
Chicago, IL
2,830
like
06/17/11 02:09 PM (14 years ago)
I've looked into that option too but just seems intrusive and that people would just uninstall the app and give it poor ratings cause of the ads in there notification bar...
 
moxdroid
Android Fan
Profile
Posts: 37
Reg: May 28, 2011
Boston
2,720
like
06/22/11 07:44 PM (14 years ago)
Any luck here? Whats the best place to put the <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android xmlns:myapp=http://schemas.android.com/apk/res/com.example.SampleApp android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent> <com.admob.android.ads.AdView android:id=@+id/ad android:layout_width=fill_parent android:layout_height=wrap_content myapp:backgroundColor=#000000 myapp:primaryTextColor=#FFFFFF myapp:secondaryTextColor=#CCCCCC </LinearLayout> /> I keep getting errors in the code when i put it in there? What layout does it go in in android 1.4
 
Lyle @SFNeNT
buzztouch Evangelist
Profile
Posts: 168
Reg: Apr 29, 2011
Chicago, IL
2,830
like
07/07/11 07:29 PM (14 years ago)
I Have Admob working great along the bottom of my app like a footer This is what I did to all the layouts that begin with act or screen that I wanted ads in. Example(my act_home): <?xml version=1.0 encoding=utf-8?> <RelativeLayout android:id=@+id/header xmlns:android=http://schemas.android.com/apk/res/android xmlns:ads=http://schemas.android.com/apk/lib/com.google.ads android:layout_height=fill_parent android:layout_width=fill_parent > <include layout=@layout/global_title_dark /> <ImageView android:id=@+id/appImageView android:layout_width=320dip android:layout_height=150dip android:scaleType=centerCrop android:src=@drawable/app_default android:layout_alignParentTop=true android:layout_marginTop=47dip /> <LinearLayout android:id=@+id/layoutMain android:layout_width=fill_parent android:layout_height=wrap_content android:layout_marginTop=205dip android:gravity=center xmlns:android=http://schemas.android.com/apk/res/android > <ListView android:id=@+id/myListView android:layout_width=fill_parent android:layout_height=wrap_content android:layout_weight=1 android:background=#000000 android:cacheColorHint=#000000 android:choiceMode=singleChoice android:scrollbars=none /> </LinearLayout> <com.google.ads.AdView android:layout_height=wrap_content android:id=@+id/adView android:layout_width=wrap_content ads:adUnitId=YOUR_ID_HERE ads:adSize=BANNER ads:loadAdOnCreate=true android:layout_alignParentBottom=true> </com.google.ads.AdView> </RelativeLayout> hope this can help us all get paid.
 
Lyle @SFNeNT
buzztouch Evangelist
Profile
Posts: 168
Reg: Apr 29, 2011
Chicago, IL
2,830
like
07/07/11 07:31 PM (14 years ago)
Also if you want the ads to run on top you have to do edits to global_tittle_dark otherwise it will cover your ads.
 
Jordan E
Aspiring developer
Profile
Posts: 43
Reg: Jul 10, 2011
Lincoln, NE
430
like
08/17/11 11:20 AM (14 years ago)
</LinearLayout> <com.google.ads.AdView android:layout_height=wrap_content android:id=@+id/adView android:layout_width=wrap_content ads:adUnitId=YOUR_ID_HERE ads:adSize=BANNER ads:loadAdOnCreate=true android:layout_alignParentBottom=true> </com.google.ads.AdView> </RelativeLayout> How do we format the banner size and ID (do we put quotes for this)
 

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.