WebOSDev - Programming has just evolved

The online blog for the webOS developer community you can find everything you need here to get a strong start developing applications for the webOS platform

AdMob.com integration

Posted by codesos Sunday, February 21, 2010

Want to add professional advertisements to your palm pre applicatio?
It's as simple as 1,2,3



1 . go to  http://code.google.com/p/admob-webos/

download admob.js and place it in your application

2. HTML File:

<div id="admob_ad"></div>
3.
Initialize:


      AdMob.ad.initialize({
                      pub_id: '*********', // your publisher id get it from admob.com
                      bg_color: '#ccc', // optional background color, defaults to #fff
                      text_color: '#333' 
                      });


and for each time you want to display ad:

 AdMob.ad.request({
                        onSuccess: (function (ad)
                        {
                        Mojo.Log.info("**************** AdMob OK ");
                           // successful ad call, parameter 'ad' is the html markup for the ad                       
                            this.controller.get('admob_ad').insert(ad); // place mark up in the the previously declared div 
                               }).bind(this),    
                      onFailure: (function ()
                      { // no ad was returned or call was unsuccessful                       
                          Mojo.Log.info("**************** AdMob ERROr ");  
                       }).bind(this),
             });


That is all , Now start earning Money!!

0 comments

Post a Comment