Skip navigation
Currently Being Moderated

Admob - Google Ads?

Oct 31, 2010 9:32 PM

Innovative - will you? where can I find flash/air integration admob android ...

...where is Google Ads - Admob plugin or similar code?

This is a must in next release Flash CS5.5/AIR2.5!

 

this is very important ...

 
Replies 1 2 3 Previous Next
  • Currently Being Moderated
    Nov 18, 2010 12:01 AM   in reply to funnyle

    i'm interested in this feature too.

    i'd like to have the opportunity to monetize my app using ads.

    I hope that Adobi will include this functionality in next release.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 23, 2010 4:57 PM   in reply to Vanquish83

    I'm interested too !

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 27, 2010 9:30 AM   in reply to YopSolo75

    Another vote here.

     
    |
    Mark as:
  • Currently Being Moderated
    Calculating status...
    Dec 8, 2010 11:14 AM   in reply to funnyle

    Can we have a response of someone from Adobe about this request?

     

    Thanks

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 12, 2010 10:33 AM   in reply to funnyle

    I agree. Timeline?

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 12, 2010 1:47 PM   in reply to funnyle

    I may be wrong, but i dont think this has anything to do with adobe. What we need is admob to provide API in as3.

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 22, 2010 7:23 AM   in reply to funnyle

    Does anyone know of any other ad providers that have an AS3 sdk?

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 23, 2010 11:44 AM   in reply to funnyle

    I was waiting for these people to chime in from the pre-release, but so far i have'nt seen either of them.

     

    In the air/android pre-release, someone ("Jean") had posted some code to work with smaato, another mobile ad provider. The last status posted was that it pulled and displayed the ads with as3, however the smaato account was not registering impressions, (the developer got no credit for the downloads). This person was waiting on a callback from smatto support, then the pre-release forum closed and that thread is gone.

     

    Someone else("nick carr") who was testing the same code, posted an example on the market called "adtest" by carr solutions, perhaps you can check that in the market and email him to see if he ever got the impressions to work properly, or if he has Jeans contact info since Jean wrote it.

     

    Also some other people reportedly were able to use Admob by using a proxy.

    Your air for android app calls a php file on your own server, and php calls the ad from admob.
    I haven't tried this at all, but it reportedly and worked perfect and is not difficult if you know php at all.

     

    I know this doesnt help much yet,  but this is what was going on in the pre-release hopefully we can bring this fprum up to date with this info.

    so far it doesn't look like any of these people are showing up on these forums yet..

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 23, 2010 8:03 PM   in reply to funnyle

    Looks like i had the example still.

    I don't want to take credit for this  (i didn't make it) It was an unfinished work in progress provided to the community by "Jean S". You may want to clean it up a bit.

     

    However it does pull an ad from smaato!

    For test purpose, publisher ID and AdSpace ID is set to 0. You will eventually change this to your own ID after signing up with smaato.

     

    Here is the source code:

    http://www.megaupload.com/?d=MEH35U9B

     

    I hate links like this, if someone can let me know a cleaner public place to upload it i will do so.

    (Or am i just crazy and not seeing the attachment link on this forum?)

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 24, 2010 5:15 AM   in reply to boat5

    Thanks boat5, very useful info.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 3, 2011 9:40 AM   in reply to Nick Eales

    Accomplishing Admob ad-serving on Adobe AIR is my current official project at work!

     

    I've seen the AdTest app as well.  I have spoken on email with Nick Carr and Jean S. from the pre-release forums.  I think they both work at carrsolutions.com from the AdTest app.  I haven't gotten a hold of Jean recently and can't find her email.  My understanding from Nick is that the page impressions are working now through Smaato, but Smaato requires >1Mio impressions and might shut down accounts who aren't meeting the quota.

     

    I'll keep you up-to-date on the progress of my company's Admob ActionScript 3 code.  We're also monitoring AdMob's blog. Really, it should be the ad network who provides the code free of charge, but if we can figure out how to code it properly, we can share/sell it with a select few!  We'll work out the kinks on here!

     

    -Adele

    AdMobAndroid.com (under construction)

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 8, 2011 11:06 PM   in reply to AdmobAndroid.com

    Any examples of either of these? I'd be willing to test!

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 9, 2011 1:44 AM   in reply to funnyle

    Another vote for this to bu built in!!!

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 11, 2011 5:28 AM   in reply to Laxidasical

    Update

     

    I've been searching the web for the last 2 weeks and haven't found anyway to do this. Does anyone have any idea how to get any ad into any app?

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 11, 2011 5:48 AM   in reply to thx1138

    I planned to look at the AdMob PHP API client sometime this week and see if I can port it to ActionScript.  I have 12 years of PHP development under my belt but unfortunately I'm very new to ActionScript.  I'll make a deal with you though.  If you can solve this issue for me I'll attempt the port later today and reply here with results!!!

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 11, 2011 6:36 AM   in reply to Laxidasical

    What are you trying to do? If you're using Flex Mobile you can use  constraints to set the size and position of the component regardless of  screen resolution or orientation.

    Screen shot 2011-01-11 at 8.31.22 AM.png

    Screen shot 2011-01-11 at 8.32.26 AM.png

    I'll send you the Flash Builder Mobile project I'm using to get ad's to work through PHP. If Flex Mobile is not an option then I can get the code for you to check when the orientation changes.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 12, 2011 7:29 AM   in reply to Laxidasical

    Laxidasical wrote:

     

     

    I planned to look at the AdMob PHP API client sometime this week and see if I can port it to ActionScript.  I have 12 years of PHP development under my belt but unfortunately I'm very new to ActionScript.  I'll make a deal with you though.  If you can solve this issue for me I'll attempt the port later today and reply here with results!!!

     

    Can you loop me in here too?  I can share the optimized Smaato code with you two.

    So far, that seems to be the only AS3 ad code working without needing your own web server to host ads and request via PHP.  But, I would prefer to use AdMob since I use AdSense, AdWords, and others!

     

    My experience is in PHP and MySQL, but I have 3+ years experience in ActionScript (not much AS3 exposure until recently).  There's a 100% chance the three of us should be able to get this working.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 13, 2011 7:24 PM   in reply to AdmobAndroid.com

    Hi,

     

    Yes. I sent you a private message with my email. Can you also send me what you have working? I will integrate it into my project so we have as many ad options as we can get working then post it online where we can get more help and exposure.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 19, 2011 8:31 AM   in reply to funnyle

    Update? Has anyone made progress on this?

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 24, 2011 6:57 PM   in reply to funnyle

    My solution (requires running .net website)

     

    1. create admob mobile web project which points to your website

    2. copy the code you get (c#) in my case and paste into http-handler/webservice

    4. filter the html returned by admob so flash can read it as urlvariables

    3. get the variables into flash (url, banner-image-url, text) by loading the http-handler

    4. make banner from variables

    5. profit ?

     

    I guess this also works via php/java ......

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 24, 2011 8:31 PM   in reply to swamp222

    ofcourse this is only a temporary solution, since you only will get mobile-web related ads and no app-ads etc.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 26, 2011 6:40 PM   in reply to funnyle

    I also would like to include Admob in my Flash/AIR apps. I have published 2 so far and the only thing holding me back now is the integration with Admob. If a solution from within the Flash/AIR SDK was possible, that would be incredible. I hope something becomes available soon.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 27, 2011 10:03 AM   in reply to CowboyBlue

    Has anyone tried using a StageWebView object and the JavaScript provided by Admob here: http://developer.admob.com/wiki/Android ?

     

    Or constructing a URL request using the information here http://developer.admob.com/wiki/Requests ?

     

    I haven't had a chance to try it yet -- just wondering if anyone had already gone down that path.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 27, 2011 10:54 AM   in reply to Joe ... Ward

    I was going down this path; but It doesn't run:

     

    Error #1014: Class flash.media::StageWebView could not be found.

    the import is fine in the IDE; it compiles also.
    So I have to figure out why it's not working; but it looks like a nice option to build a view and connect to the ad-site of you choice.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 27, 2011 3:43 PM   in reply to NanoMInd

    Possibly you need to compile to a later SWF version or update the namespace of the application descriptor to 2.5. For the SWF version in Flash Builder, add -target-player 10.1 to the compile options. However, if you are targeting the iPhone, note that the StageWebView class was added in AIR 2.5 and isn't available on iOS yet.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 27, 2011 6:51 PM   in reply to Joe ... Ward

    Anyone know how to hide the scrollbars? Here's what I wrote and it works for loading a page from my site. I still haven't implemented it for using admob. I'm new to admob so first was getting it to display. Can I set up a hidden page on my url and load it in?

     

    import flash.display.MovieClip;
    import flash.media.StageWebView;
    import flash.geom.Rectangle;
    var webView:StageWebView = new StageWebView();

     

    function StageWebViewExample()
    {
        webView.stage = this.stage;
        //webView.viewPort = new Rectangle(0,0,stage.stageWidth,stage.stageHeight);
        webView.viewPort = new Rectangle(0,0,stage.stageWidth,50);
        webView.loadURL( "http://www.bluetoastmedia.com" );
    }
    StageWebViewExample();
    //------------------------

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 27, 2011 6:57 PM   in reply to CowboyBlue

    Actually, once I run it as an app, the viewport takes over the entire screen regardless...

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 27, 2011 9:50 PM   in reply to NanoMInd

    I have it working with a straight image but not a page yet.

     

    Sent via Android.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 28, 2011 9:07 AM   in reply to boat5

    Does anyone have an working example of this smaato example?

     

    I can’t get the impressions to register or solve this problem.

     

    Thanks

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 28, 2011 9:11 AM   in reply to CowboyBlue

    I´ve manage to pull and successfully register the impressions and clicks using the StageWebView, in an air4android app, but I can’t get rid of the scroll bars and zoom buttons.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 28, 2011 11:16 AM   in reply to razorskyline

    I get no ads using this javascript in my html page... I however have the scrollbars gone. Anyone?

     

     

    <script type="text/javascript">
    var admob_vars = {
    pubid: 'a14d430b52xxxxx', // publisher id
    bgcolor: '000000', // background color (hex)
    text: 'FFFFFF', // font-color (hex)
    ama: true, // set to true and retain comma for the AdMob Adaptive Ad Unit, a special ad type designed for PC sites accessed from the iPhone.  More info: http://developer.admob.com/wiki/IPhone#Web_Integration
    test: false // test mode, set to false to receive live ads
    };
    </script>
    <script type="text/javascript" src="http://mmv.admob.com/static/iphone/iadmob.js"></script>

     

    Any idea why no ads show up even in the browser on my Android? Requests show to be coming in. I even made a house ad to see if it would serve... nuthin.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 28, 2011 11:30 AM   in reply to CowboyBlue

    I'm using smaato and the provided php code, and its working.

     

    haven't tried with admob yet.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 28, 2011 1:50 PM   in reply to CowboyBlue

    This code isn't working for me either.  I can't even to display an ad when I'm using the browser on my laptop...

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 28, 2011 1:57 PM   in reply to Laxidasical

    I don’t really know why, but this only works if the app is running on the mobile device,

    on the laptop I can’t see anything either.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 28, 2011 2:28 PM   in reply to Laxidasical

    I couldn't get it to work using the first example provided by adMob, either. What did work was to use the "manual" mode and call the fetchAd() method in the adMob Javascript code directly.

     

    This is the HTML file that I loaded into my StageWebView object:

     

    NOTE: change the publisher ID to your own -- or I will get credit for your ads!

     

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Untitled Document</title>
    <script type="text/javascript">
    var admob_vars = {
      pubid: 'a14d4115a7779ac', // publisher id
      bgcolor: 'ffffff', // background color (hex)
      text: '000000', // font-color (hex)
      test: false, // test mode, set to false if non-test mode
      manual_mode: true

     

    };

    function showAd()
    {
         //alert("show ad");
        _admob.fetchAd(document.getElementById('adspace'));

    }
    </script>
    <script type="text/javascript" src="http://mm.admob.com/static/iphone/iadmob.js"></script>
    <style type="text/css">
    body {
        margin-left: 0px;
        margin-top: 0px;
        margin-right: 0px;
        margin-bottom: 0px;
    }
    </style>
    </head>

     

    <body onload="showAd()">
    <div id="adspace">

     

    </div>
    </body>
    </html>

     

    And this is the ActionScript code (I did this using Flash CS on the main timeline, if you are doing this in Flash Builder or in a class, you will have to adapt it accordingly):

     

    //Admob
    var webView:StageWebView = new StageWebView();
    webView.stage = this.stage;
    var adViewPort = new Rectangle( 0, 0, this.stage.stageWidth, 60 );
    webView.viewPort = adViewPort;

     

    webView.addEventListener(ErrorEvent.ERROR, onWebViewError );
    webView.addEventListener(LocationChangeEvent.LOCATION_CHANGING, onWebViewLocChanging );
    webView.addEventListener(LocationChangeEvent.LOCATION_CHANGE, onWebViewLocChange );

     

    var templateFile:File = File.applicationDirectory.resolvePath( "adview.html" );
    var workingFile:File = File.createTempFile();
    templateFile.copyTo( workingFile, true );
    var fstream:FileStream = new FileStream();
    fstream.open( templateFile, FileMode.READ );
    var htmlString:String = fstream.readUTFBytes( fstream.bytesAvailable );

     

    try
    {
        //webView.loadString( htmlString );
        webView.loadURL( workingFile.url );
    }
    catch (e:Error)
    {
        trace( e );
    }

     

    function onWebViewLocChange( event:LocationChangeEvent ):void
    {
        trace( "--------------- Change to" + event.location );
        if( event.location != workingFile.url )
        {   
            trace("----------- reset ad URL ----------");
            navigateToURL( new URLRequest( event.location ) );
            try
            {
                //webView.loadString( htmlString );
                webView.loadURL( workingFile.url );
            }
            catch (e:Error)
            {
                trace( e );
            }
        }
    }

     

    function onWebViewLocChanging( event:LocationChangeEvent ):void
    {
        trace( "--------------- Changing " + event.location );
        event.preventDefault();
        navigateToURL( new URLRequest( event.location ) );
    }

     

    function onWebViewError( error:ErrorEvent ):void
    {
        trace( error );
    }

     

    One issue I noticed is that the method shown above in AS won't work when you are running on the app through ADL (or Test Movie in Flash CS, etc). You can use the loadString() method, which is commented out. The reason for this is that the StageWebView control is implemented in different ways on different OS's. AIR only controls the desktop control, the other OS's use the OS supplied code.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 28, 2011 2:06 PM   in reply to funnyle

    Has anyone tried using the Flash Lite code that Admod provides?  The classes are in ActionScript.  I'm still learning ActionScript, so I'm not sure if I can get this working...

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 28, 2011 2:07 PM   in reply to funnyle

    I have it working with Admob now. I think there was a time

    period that I had to wait for the server to update? I don't know but it works now. I manually added the d

    imensions of the webview object to make the scrollbars go away. I can't believe it!


     
    |
    Mark as:
  • Currently Being Moderated
    Jan 28, 2011 3:00 PM   in reply to Joe ... Ward

    It works on the desktop for me in a FlashDevelop Android/AIR template. No luck in the "regular" AIR FlashDevelop or in Flex. So I don't know at the moment what exactly is the "magic setting". But I'am happy with the progress

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 28, 2011 3:11 PM   in reply to NanoMInd

    Well here is my code stored on my URL

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    </head>
    <body bgcolor="#000000">
    <script type="text/javascript">
    var admob_vars = {
    pubid: 'my_id', // publisher id
    bgcolor: '000000', // background color (hex)
    text: 'FFFFFF', // font-color (hex)
    ama: false, // set to true and retain comma for the AdMob Adaptive Ad Unit, a special ad type designed for PC sites accessed from the iPhone.  More info: http://developer.admob.com/wiki/IPhone#Web_Integration
    test: false // test mode, set to false to receive live ads
    };
    </script>
    <script type="text/javascript" src="http://mmv.admob.com/static/iphone/iadmob.js"></script>
    </body>
    </html>

    Here is my AS3:

    import flash.display.MovieClip;
    import flash.media.StageWebView;
    import flash.geom.Rectangle;
    var webView:StageWebView = new StageWebView();

     

    function StageWebViewExample()
    {
        webView.stage = this.stage;
        //webView.viewPort = new Rectangle(0,0,stage.stageWidth,stage.stageHeight);
        webView.viewPort = new Rectangle(0,0,800,85);
        webView.loadURL( "myURL/page.html" );
       
    }
    StageWebViewExample();

    ----------------------------------------

    Now I need to figure out how to make the viewPort redraw when the ad is clicked...

    Any suggestions?

     
    |
    Mark as:
1 2 3 Previous Next
Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points