Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 5    Views: 106

SrikarSree
Aspiring developer
Profile
Posts: 79
Reg: Jul 22, 2012
Bangalore
7,090
02/25/13 09:41 AM (12 years ago)

Getting Errors - Admob Integration Into Android App

Hi I am following the steps given for the Admob integration and when i add the setContentView(R.layout.main); in my BT_active_base.java within onCreate getting an error message "main cannot be resolved or is not a field" I have changed the google api to 13 and also clean and built.
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
02/25/13 10:29 AM (12 years ago)
It's a lot easier to use the xml version of admob. Where do you want the ads to show (top or bottom)? Are you using a tabbed layout or menus, or something else?
 
SrikarSree
Aspiring developer
Profile
Posts: 79
Reg: Jul 22, 2012
Bangalore
7,090
like
02/25/13 10:42 AM (12 years ago)
@Raveyd, I am using non-tabbed layout and it starts with a simple menu plugin. The menu displays quiz and html doc plugin. I think we need to implement the xml in main.xml and can you please point out which is the main.xml or should i modify each xml file in the layout folder.
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
02/25/13 11:08 AM (12 years ago)
You've got it. Modify each xml file. I suppose you could try putting it in the act_base.xml, but I've never really bothered to try modifying that as it's a container for all the other views. I asked about tabbed layout as you could put the xml in the act_root_tabs.xml one time and have banners showing in every tab view. Also, I'd recommend using ads:adSize="SMART_BANNER" instead of ads:adSize="BANNER" if you're not already, as that'll resize ads depending on device size.
 
SrikarSree
Aspiring developer
Profile
Posts: 79
Reg: Jul 22, 2012
Bangalore
7,090
like
02/25/13 11:32 AM (12 years ago)
@Raveyd, Thanks for your feedback, I shell try you advice and report it here for reference :-)
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
02/25/13 11:43 AM (12 years ago)
No problem @SrikarSree - you should find the xml route fairly straightforward, but post back if you have any issues.
 

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.