About Store Forum Documentation Contact



Post Reply 
ADvertisment (Adds) help
Author Message
AndrewBGS Offline
Member

Post: #1
ADvertisment (Adds) help
Hi, I'm trying to add Ads to my android application but I can't seem to figure out how to use it.

I got myself an ID, and a dummy ID too for testing; In the init function of the main state of the game, I have

Ads.bannerCreate(....);
Ads.bannerVisible(true);
Ads.bannerShow();
Ads.testMode();

- I've tried other combinations, such as calling show in the draw() function, but I couldn't get to see anything. I thought displaying the Ads.bannerState() would help me, and that turns out to be always 0.

Can someone please tell me what am I doing wrong, and what's the right way to use Ads? (also, can I check this on windows also, or will I only see Ads on an android device?)
12-21-2014 09:47 AM
Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #2
RE: ADvertisment (Adds) help
So, does no one know how to use adds? :(
I was really hoping someone would help me out with this.
12-23-2014 08:49 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #3
RE: ADvertisment (Adds) help
Hello!

Next release will feature this new tutorial:
Code:
/******************************************************************************/
const bool TestMode=true; // !! WARNING: if you disable test mode, and click on your own Ads, you may be banned from AdMob !! Do not click on your own Ads !!
/******************************************************************************/
void InitPre()
{
   EE_INIT();
#if !defined ANDROID && !defined IOS
   Advertisements are not supported on this platform
#endif

   if(TestMode)Ads.testMode(true); // enable test mode
  
   Ads.bannerCreate("ca-app-pub-".., Advertisement.BANNER); // create banner from your AdMob Banner Unit ID, which is obtained from https://apps.admob.com/#monetize
   Ads.bannerShow(); // display the Ad once it finishes loading
}
/******************************************************************************/
bool Init()
{
   return true;
}
/******************************************************************************/
void Shut()
{
}
/******************************************************************************/
bool Update()
{
   return true;
}
/******************************************************************************/
void Draw()
{
   D.clear(TURQ);

   Str state; switch(Ads.bannerState())
   {
      case Advertisement.NONE   : state="None"   ; break;
      case Advertisement.LOADING: state="Loading"; break;
      case Advertisement.DONE   : state="Done"   ; break;
      case Advertisement.ERROR  : state="Error"  ; break;
   }
   D.text(0,  0  , S+"Banner State: "+state);
   D.text(0, -0.1, S+"Banner Size: " +Ads.bannerSizePx());
}
/******************************************************************************/
12-24-2014 11:53 PM
Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #4
RE: ADvertisment (Adds) help
Thanks A LOT!
This will be very useful, and I appreciate a lot you taking time to do this.

Thank you very very much smile
12-25-2014 07:59 AM
Find all posts by this user Quote this message in a reply
Post Reply