[iOS & Android] AdMob Extension [2.1] [DEPRECATED]

Abliblablobla

  • *
  • Posts: 524
Hello, I am trying to get ads on my Android app.  But they're not showing up.   When I run it through Apples iPhone simulator ads show up though.  I've entered in my AdMob publisher ID into Stencyl 3.0 and I have a mobile version of Stencyl.   Ads are just not displaying for Android.     Any suggestions?  Is AdMob working with Android?

Additional info;
I've downloaded the AdMob extention, but when I try to install it..    I select the admob.zip and press install, and it does nothing in stencyl.  It's like it wont install it.

If I understand correctly you are using the Stencyl built-in AdMob extension instead of this one. If you want to use this extension you have to use the green blocks under "custom blocks". They appear once you have correctly installed this extension. If you are having troubles when you try to install this extension, this thread may help you: http://community.stencyl.com/index.php/topic,30388.msg174073.html#msg174073

.: BuruBuru :.

Abliblablobla

  • *
  • Posts: 524
I'm attempting to use an interstitial ad at a game over screen, but it keeps crashing. What order should my blocks be in? Right now this is the order: Load--Initialize--show


No, that is NOT the correct order. You have to use those blocks in this order:
  - Initialize: you have to use this block only once in your game.
  - Load: Every time you want to show an interstitial you have to load it first. It may take some time to load an interstitial depending on the speed of the internet connection.
  - Show: use this block to show an interstitial. If there is no interstitial to show or if it is still loading an interstitial this block does nothing.

If you want more detailed information, you can read the documentation (you can find it at the end of the first post).
.: BuruBuru :.

Abliblablobla

  • *
  • Posts: 524
#Abliblablobla

You should update the admob\template\android\androidmanifest.xml  the current state of this has to old variables and it removes the com.android.vending.BILLING permission from the builded apk....making all of the IAP's for android invaild (you cannot add IAP in google play). 

Edit: I had to manually update androidmanifest  sent you a PM with the fix guide

Thanks mat0pad!
I have just uploaded a new version with small fixes to the extension. I had to overwrite the existing AndroidManifest.xml file because it lacked some of the permissions I had to have in order to create this extension. Now Stencyl comes with an updated AndroidManifest.xml that has all the permissions needed for this extension, so I don't need to overwrite the AndroidManifest.xml file anymore. Thanks for pointing it out!
.: BuruBuru :.

Abliblablobla

  • *
  • Posts: 524
Hi,
why if I use this extension, after it show few ads, they disappear ?
while if I use standard block from Stencyl, they are always show in all my scenes.

Thanks

P.s.: for use this extension, I have remove admob publish key from setting-mobile-monetization

Stencyl uses a simplified version of this extension. The Stencyl built-in extension shares the SAME code with this extension, so I strongly doubt that you can get different results when you simply want to show a normal banner. Please be sure you correctly installed this extension. If you installed this extension correctly, you should see some green blocks for AdMob under the "Custom" tab.
.: BuruBuru :.

RulezTeam

  • *
  • Posts: 316
I can use green block, so your extension are correctly installed.
But If I use only block from stencyl, ads are always showed, while it's not so if i use your block.
Two little question:
- if I use your extension, do I configure in setting/mobile/monetization admob publisher key ? Or I configure it only in your block ?
- Is it possible that this extension can use more cpu under android ? I see that when I close a game (background) cpu tend to stay at 10%, while if I disable this extension and disable block green, cpu stay at 1/2%.

Thank you

Abliblablobla

  • *
  • Posts: 524
I can use green block, so your extension are correctly installed.
But If I use only block from stencyl, ads are always showed, while it's not so if i use your block.
Two little question:
- if I use your extension, do I configure in setting/mobile/monetization admob publisher key ? Or I configure it only in your block ?
- Is it possible that this extension can use more cpu under android ? I see that when I close a game (background) cpu tend to stay at 10%, while if I disable this extension and disable block green, cpu stay at 1/2%.

Thank you

I'm not saying you are wrong, but I want to stress the fact that Jon used this extension to add AdMob support for Stencyl. If you look inside your-stencyl-folder/plaf/haxe/extensions/ads/project/android/AdWhirl.java and compare it with your-stencyl-folder/plaf/haxe/extensions/admob/project/android/MyAdmob.java you will notice that the code for admob banners is pretty much the same. Even the AdMob libraries are the same.
- No, you don't have to configure your AdMob publisher key in the Settings if you want to use this extension. Use your AdMob publisher key (AdMob Unit ID) in the blocks when you need to show a banner.
- This extension uses some CPU when it is loading a banner/interstitial. It isn't noticeable on mid to high-end devices, but someone already reported that there could be a lag on very low-end (single core 600~800 MH) when loading a banner/interstitial. This is also true for the built-in Stencyl version of this extension so there shouldn't be any differences.

As a side note, are you clicking on the banners when they show up? Google AdMob detects "suspicious" activities and stops them for a while. For example, if you click on a banner 50% of the times it shows up, you will have a 50% CTR (click through rate) which is extremely high (a normal CTR range goes from 0.5% to 2.0%).  AdMob detects your very strange CTR and it notices that your clicks come from very few devices, so it thinks that you are trying to "cheat" in order to earn more money. AdMob then stops sending banners to your devices for some time. If continue to click on your own banners, AdMob will ban you from its ad network and you won't be paid.
.: BuruBuru :.

RulezTeam

  • *
  • Posts: 316
Thank you very much Abliblablobla for your explanation.
Only one more (stupid) question : when I use your green block to show ads banner, where are you recommend to use it to show in all scenes ? In starting Scene ? Or should I use it in every scene that I want to show ads ?

WestsideDwarf

  • Posts: 5
Hello, My  ads are not appearing (banner and Interstitial). I have set up my admob account and have gotten the Unit ID. I have used both the Stencyl blocks and the Extensions blocks - Neither of them seem to be working. There is no sign that either have failed to load.

mat0pad

  • Posts: 364
Hello, My  ads are not appearing (banner and Interstitial). I have set up my admob account and have gotten the Unit ID. I have used both the Stencyl blocks and the Extensions blocks - Neither of them seem to be working. There is no sign that either have failed to load.
What platform are you testing on?
   


                              

WestsideDwarf

  • Posts: 5
Android testing on a samsung galaxy S4

WestsideDwarf

  • Posts: 5


I got it figured out. Turns out  I had a space  before my app id. Silly me!

Abliblablobla

  • *
  • Posts: 524
Thank you very much Abliblablobla for your explanation.
Only one more (stupid) question : when I use your green block to show ads banner, where are you recommend to use it to show in all scenes ? In starting Scene ? Or should I use it in every scene that I want to show ads ?

You don't need to use the "show banner" block every time you switch to a different scene. If you use a "show banner" block you don't need to use it again unless you use a "hide banner" block. So if you want to show a banner at the top of your starting scene, you can use it there and the banner will stay there even if you switch to another scene, until you hide it. In my opinion, it isn't a good idea to show a banner (or an interstitial) before a user starts to play because he/she would say: "What? I have not even started to play this game and I am already seeing ads?".
And last but not least, you don't have to use a "show banner" block to refresh its content because it refreshes by itself.
.: BuruBuru :.

Abliblablobla

  • *
  • Posts: 524
Hello, My  ads are not appearing (banner and Interstitial). I have set up my admob account and have gotten the Unit ID. I have used both the Stencyl blocks and the Extensions blocks - Neither of them seem to be working. There is no sign that either have failed to load.
I got it figured out. Turns out  I had a space  before my app id. Silly me!

This can be a very common mistake because the Ad Unit ID is very long and the easiest way to write it somewhere is to copy and paste it over, possibly including an unwanted whitespace. I will add a note about this in the documentation as soon as I have some spare time.
.: BuruBuru :.

ManlyMouse

  • Posts: 144
Hi, got some pretty silly questions.

If I dont have Stencyl 3.0 nightly, will the tiles still show up?
Can I test my game to see if the ads work through stencyl's test feature?
I know more about Stencyl now.

RulezTeam

  • *
  • Posts: 316
Thank you very much Abliblablobla for your explanation.
Only one more (stupid) question : when I use your green block to show ads banner, where are you recommend to use it to show in all scenes ? In starting Scene ? Or should I use it in every scene that I want to show ads ?

You don't need to use the "show banner" block every time you switch to a different scene. If you use a "show banner" block you don't need to use it again unless you use a "hide banner" block. So if you want to show a banner at the top of your starting scene, you can use it there and the banner will stay there even if you switch to another scene, until you hide it. In my opinion, it isn't a good idea to show a banner (or an interstitial) before a user starts to play because he/she would say: "What? I have not even started to play this game and I am already seeing ads?".
And last but not least, you don't have to use a "show banner" block to refresh its content because it refreshes by itself.

Thank you Abliblablobla.
Is there a possibility to block or stop or close (not to hide) ads ?
For example I need to stop it when I lose focus.

Thank you