Discussion Forums  >  Uncategorized

Replies: 4    Views: 291

steveh6883
buzztouch Evangelist
Profile
Posts: 383
Reg: May 15, 2011
Gosport, UK
3,830
06/16/11 05:36 PM (14 years ago)

trying to implement push ads but getting stuck

Hi All Probably one for David After having no luck with AdMob in v1.4 Android, am now trying push ads but getting a bit lost along the way (again!) Have installed the releveant JAR, build path, added to libraries etc Have tweaked the manifest as per the given instructions - no problems so far But am now getting stuck on the final 2 stages - 1. editing the onCreate() method: am supposed to add a - (getApplicationContext(), <appid>,<apikey>); (obviously with relevant appid & apikey), & as per instructions this is located in the main.java, but can't find the file (you may have named it something else) believe it's the file that does this: public class main extends Activity { 2. setting the boot receiver: not really a problem as it says if there isn't one then just create one named bootreceiver.java & put relevant code in BUT once created one, where should I put it? if there is a bootreceiver (can't find it) may have been named something else, believe it's the file that does this: public class BootReceiver extends BroadcastReceiver { NB- Those who say 'Code Is Art' are definitely right - A Black Art! Any help is appreciated
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
06/16/11 09:53 PM (14 years ago)
Black Art, no doubt! I'm a bit lost on this because I've not worked with the AdMob + Android combo. But, we'll see what we can figure out. So.. the onCreate() method, as you've probably already realized is in each activities .java file. So, this means there are a bunch of Activites, each with their own .java file and each with their own onCreate() method. I'm guessing the documents you're using (from AdMob) are referring to 'one activity' - like a test activity to put ads in. Activities are Views, they are probably walking you through getting ads runnin on one View (an activity). So, your v1.4 app loads different views for different screen types. This means you may not even be sure which view you're working with. The home-screen on your app uses the Act_Home.java file, lets assume you're working there. It has it's own onCreate() method staring on line 54. This is the method you'll be adding the getApplicationContext(....) code you posted above. You'll end up doing this in whatever views (activiites) you want ads in. Most of these activities start with Screen_....java Example, the Custom URL views run in the Screen_CustomURL.java file, it will have it's own onCreate() method. Next, 'boot receiver' not sure what this is, LOL. The project for sure does not have one already. This means you'll need to create it I guess?
 
Lyle @SFNeNT
buzztouch Evangelist
Profile
Posts: 168
Reg: Apr 29, 2011
Chicago, IL
2,830
like
07/21/11 09:48 PM (14 years ago)
Writing a step by step blog on adding Admob to a Buzztouch app when finished will post a link for all.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
07/23/11 01:25 AM (14 years ago)
@SFNeNT: Whoo hoo on a step-by-step
 
Lyle @SFNeNT
buzztouch Evangelist
Profile
Posts: 168
Reg: Apr 29, 2011
Chicago, IL
2,830
like
07/23/11 07:54 PM (14 years ago)
Here is a link to my step-by-step blog on adding admob ads to a buzztouch app and getting them to run along bottom of screen like a footer...http://sfnent.blogspot.com/2011/07/ easy-guide-on-how-to-make-money-with.html
 

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.