Admob Issue with Android

So I was trying the admob webpop up hack for Android and I can’t for the life of me get it to work correctly. I get it to show the ad just fine, but when I click on the ad, it just opens in the popup window and not in the actual browser. The code is identical to my iphone version and it works flawlessly.

I know there have been discussions on this not working as well on Android, but I never saw any final resolutions.

So tell me…Is anybody currently building an android app and getting the admob hack to work?

BTW, I am using a Nexus S for testing, if that may make a difference.

Thanks [import]uid: 13512 topic_id: 5882 reply_id: 305882[/import]

So I take it no one is implementing this for Android right now or they are not reading this forum…
So I am just bumping it up on the off chance someone will see this. [import]uid: 13512 topic_id: 5882 reply_id: 21434[/import]

Hey Jason, I implemented the hack earlier today, only problem is that I don’t have an Android phone to test it. So, I posted around the net for android testers to get feedback wether my game works or not. I’m still waiting to hear from people.
[import]uid: 10332 topic_id: 5882 reply_id: 21608[/import]

Great, I look forward to hearing how it goes, also I hadn’t thought of asking other people to test. It may have something to do with Android Version 2.3 that I am running for all I know. [import]uid: 13512 topic_id: 5882 reply_id: 21615[/import]

I’m not sure if I’m doing the admob hack right but I’m not seeing anything popup when I install my app to my nexus one [import]uid: 12716 topic_id: 5882 reply_id: 21755[/import]

Your suppose to put the main.lua code anywhere you want…change the id in the ad.html file…and throw that in the app directory…and it should all just work right? [import]uid: 12716 topic_id: 5882 reply_id: 21757[/import]

ciaphuas…
That’s how I understood it to work. You can try it with a test ad by setting by setting the test: variable to true (if its not that way already) in the ad.html. I now there was an update to the Lua code last week to help with returning ads more consistently, but it should still work. [import]uid: 13512 topic_id: 5882 reply_id: 21857[/import]

spacehunter…
If you want, I could test your app on my android to see if it exhibits the same behavior. Just let me know. [import]uid: 13512 topic_id: 5882 reply_id: 21858[/import]

Hey Jason,

That would be great!!

Here’s the link:

http://bit.ly/f2AXyc

thanks! [import]uid: 10332 topic_id: 5882 reply_id: 21861[/import]

Spacehunter,
So, I didn’t even see the ad show up, although I assume it is supposed to be on the bottom of the game screen. But I see nothing at all, just the game background.

I kind of tested a few other things out for ya, if you want the feedback, just let me know your email and I can send some feedback to you. All in all though, it seems to work pretty well (other than the ad thing of course).

[import]uid: 13512 topic_id: 5882 reply_id: 21862[/import]

well, that’s not good :slight_smile:

Appreciate you testing it out for me. Please send feedback to joe [at] webappstogo [dot] com [import]uid: 10332 topic_id: 5882 reply_id: 21864[/import]

I may have fixed it now! It appears to work in the simulator. I need to go buy me a cheap android phone somewhere. Anyone know where I can get one? :slight_smile:
[import]uid: 10332 topic_id: 5882 reply_id: 21883[/import]

Could you please tell me how you got it to work?

It never works on Android, most of the time it is just a grey box, sometimes it will display the ad on but when you click on it nothing happens or it opens the ad inside the little banner ad!

It never works on simulator??

[import]uid: 11459 topic_id: 5882 reply_id: 23147[/import]

Hi all,

Sorry I haven’t gotten around to looking at the AdMob code on Android until now. I took a look at it and here’s what I found, which, ultimately, isn’t the best of news:

  1. The basic code works fine, as long as you include “android.permission.INTERNET” in your build.settings file. Once this is done you should be able to see the test ad show up.

  2. AdMob states on their site that even when your code is set to load live ads, you may not always get an ad. So please don’t necessarily blame my code if this is what happens to you. :slight_smile: Unfortunately, it looks like the webpopup implementation on Android doesn’t support transparent backgrounds, so if no ad shows up you’ll see a white background where the ad should be.

  3. When clicking on an ad, it doesn’t open up in a new window. This appears to be due to a bug in the webpopup implementation on Android - the url that’s supposed to be opened doesn’t get passed through the urlRequest listener function associated with the webpopup, and it’s that function that’s responsible for loading the url in the full browser window. It may be possible to hack around this somehow, perhaps through the ad.html file that actually does the ad loading, but I haven’t looked into this yet.

So there you go. Ultimately, this was never intended to be more than a temporary workaround until Ansca adds native ad support to the SDK. Hope we see that soon!

Thanks,
Darren [import]uid: 1294 topic_id: 5882 reply_id: 26460[/import]

Thanks Darren!

Thanks your code is perfect on the iPhone, but as you say it appears the Corona urlRequest doesnt work on Android. I did try to hack it by trying to get the ad url from the admob javascript and posting it from a form back to corona. But didn’t have much luck

Thanks anyway [import]uid: 11459 topic_id: 5882 reply_id: 26486[/import]

Can U check my beta version game for Android? Seems to work fine with AdMob:
https://market.android.com/details?id=pl.concat.thegolfwarlite
Regards [import]uid: 12704 topic_id: 5882 reply_id: 26787[/import]

Hi gtatarkin,

I installed your game and played through about 8 or 9 holes, and never saw an ad, or a spot where it seemed like an ad should appear. Tested on a Nexus One. Where should I look for an ad? Also, what happens when you click an ad? Does it open the link in a new window, or inside the same webpopup that contains the ad? The latter is what was happening to me, so if you’ve figured out a workaround for it, that’s great.

Thanks,
Darren [import]uid: 1294 topic_id: 5882 reply_id: 26808[/import]

Ads should open through system.openURL( url ) directly to Android Market. Will check this again but it should work I think. [import]uid: 12704 topic_id: 5882 reply_id: 26816[/import]

Nope just checked it on HTC desire running 2.2, crashes the app when you press on the ad. This is bad because you are breaking admob terms and conditions by having an ad not running properly.

This is with build 312 of corona [import]uid: 11459 topic_id: 5882 reply_id: 27048[/import]

It’s just my first try to deal with AdMob problem on android. Works great on my device (HTC Desire Z - Android 2.2.1) but lots of users report different kind of problems with ads. Need to look at code again ASAP. [import]uid: 12704 topic_id: 5882 reply_id: 27051[/import]