Here is mine. You can copy past it if you like. Make sure that you can see the new view you add in your grid layout view. it might be off screen. Change your positioning as you need it. This is currently set for middle bottom.
IF you cant see ads. make sure you put back the default ids so you see the test ad on simulator. if you see test ad but not actual ads then campaign is not on. if you dont see test ad then its either off screen or you might have placed it outside the main grid object
Glad to help Larry. Notice on google docs they don’t add “name” parameter. I tried this when I needed to hide/unhide it. Adding the name allowed this. Also added extra bits like auto collapses although this will remove the black square if no banner is available so might look like it’s not working. Best to disable this till it’s all working.
Also running into an issue now with Interstitial ads. Ive noticed a big slow down when using Runtime enter frame events after an Interstitial has been created. It runs well if I dont create the ad but like a dog if I do. It seems that although the ad is dismissed, it is doing something still. I need to be able to remove it.
First, I recommend that you add the AdView (ie: AdMob’s banner ad) to your CoronaPanel. That way it’ll always be rendered/displayed on top of Corona. Or at least add your ContentPanel to the CoronaPanel. You can do so as follows…
fCoronaPanel.Children.Add(bannerAd);
When you want to remove the ad banner from the page, then you remove it from the “Children” collection. This is the equivalent to Corona’s DisplayGroupObject:remove() function in Lua. You can do so as follows…
fCoronaPanel.Children.Remove(bannerAd);
Hopefully, Google coded this right on their end and set up their AdView to stop requesting ads from the Internet when it has been “Unloaded” from the page, which happens when you remove it.
Regarding interstitial ads slowing down your app, I’ve only noticed this happening the first time I called LoadAd(). I didn’t see any slow-downs after showing/dismissing the interstitial ad or with subsequent calls to LoadAd(). I’ve tested this with our “Physics\ManyCrates” sample app that I cranked up to 60 FPS.
Also, is there a reason why you’re hooking into “enterFrame” events? What are you using it for?
I dont need to remove the banners. They arent causing any problem. They are fine.
I need to find away to remove interstitial as in the code above - i need to remove al instances of it and see if that works. I dont know if it will.
What I have running on enterframe an on screen touch event running and an audio function that wobbles pitch. It all works fine until an ad comes up an is dismissed. Its as if its still there.
Im just porting something across that works fine on Android and IOS and actually does work on Windows Phone until the Interstitial is dismissed.
The APIs provided by Google’s InterstialAd is very limited. There is no means of removing anything via their class. I would assume that Google creates a XAML page when showing an interstial ad and then they remove the page from the app when you back out of it or tap the (x) button. Also, since it’s .NET based, the garbage collector would not immediately destroy the interstial ad’s page. So, you could try forcing garbage collection yourself when returning to your MainPage. You can do that in .NET via the static System.GC.Collect() method. Just be warned that doing this will likely cause a short performance hit.
Also, does your app perform better without the “enterFrame” event?
I ask because I’m not seeing this performance issue in my interstiad ad example app. But also, performing a lot of work on every frame is a very expensive thing to do on all platforms. I suggest that you start looking in your enterFrame code first.
I would normally but it captures motion and redraws on screen. If it goes slower then it wont be as smooth. Also theres an LFO style pitch control happening at the same time and needs to be smooth. I will see about maybe thinning the updates down a little. I wonder if its related to movement events as in mentioned previously. Even so as I said it works fine and as it should If I dont use interstertial ad at all. Maybe Im better of just not using it for this particular project.
I tried that system.gc.collect and no joy. Even nulled everything first. I was wondering how I could possibly use some kind of Destroy or Dispose.
I figured out what it was. I had made an ad banner rotate experiment with windows ad banner(2) and google ad banner and was cycling through hiding and unhiding them. This seemed to be too many banner ads for the system to handle once the interstitial came in. Simple Corona Runtimes slow down. It is still odd that the interstitial is still hanging round somewhere after it is dismissed. This is Googles lack of function to remove it.
IF you want to recreate my issue just create three windows ad banners on screen then add this code to Main and it will work as expected until an interstitial comes in.
(just swap the cursor with any small image)
For now Ill stop being greedy and stick to one or two ad banners.
local cursor=display.newImage(“cursor.png”,0,0)
local function runtimeTestFunction()
cursor.x=xPos;
cursor.y=yPos;
end
local function updatePosition(event)
if event.phase==“began” or event.phase==“moved” then