Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

ADMOB integration ?

Has anyone already successfully integrated ADMOB advertisements ?

— asked May 21st 2010 by Johan Pyfferoen
  • admob
  • android
  • iphone
0 Comments

9 Answers

  • You can find an early implementation of AdMob for Android at http://CrucialDivide.com/titanium-ads.jar which should against the latest build of Titanium (1.3.1). Currently there's a fair amount of debug info but it's working, ads are refreshed and it handles the emulator, events, properties, etc.

    You should be able to drop the .jar into your mobilesdk folder and it'll be picked up by Ti. On linux this would generally be: $HOME/.titanium/mobilesdk/linux/1.3.1/android/modules

    An example of how to use it can be found:
    http://gist.github.com/439986

    If you're interested in the complete source, a little rough around the edges, then you can find my working copy of Ti here - http://github.com/dasher/titanium_mobile/tree/dasher

    Just an FYI - it's built to support multiple ad providers as you'll see from the gist although currently it's only AdMob.

    Update:
    I can't check the Appcelerator TOS page due it not working - so if it's against the rules then I'm sure Appcelerator will let me know.

    You can grab a full 1.3.1 from http://CrucialDivide.com/mobilesdk-1.3.1-linux.zip

    If you need complete instructions:

    1) Download 
    2) Open archive 
    3) extract to ~/.titanium/mobilesdk - you should now have a 1.3.1 folder 
    4) Open Ti desktop tool:
    4.1) select your project
    4.2) select the edit panel and select 1.3.1 from the list of available SDK
    
    — answered June 15th 2010 by David Ashwood
    permalink
    4 Comments
    • Implementing now. Hoping it will work…. please oh please.

      — commented June 16th 2010 by Ryan Tregea
    • Didn't work out of the box in Mobile SDK 1.3.0.
      For anyone that knows what it means. It said, Cannot convert createAd to java.lang.Object[]

      I'll try again with 1.3.1

      — commented June 16th 2010 by Ryan Tregea
    • perhaps not on the 1.3.1 build, The instructions are sporadic at best. I would have thought a titanium app that downloads and builds the source would have been first on the list, Or a precompiled daily build and auto downloader built in titanium perhaps.

      — commented June 16th 2010 by Ryan Tregea
    • I can't check the Appcelerator TOS page due it not working - so if it's against the rules then I'm sure Appcelerator will let me know.

      You can grab a full 1.3.1 from http://CrucialDivide.com/mobilesdk-1.3.1-linux.zip

      For those who need complete instructions:
      1) Download
      2) Open archive
      3) extract to ~/.titanium/mobilesdk - you should now have a 1.3.1 folder
      4) Open Ti desktop tool, select your project, select the edit panel and select 1.3.1 from the list of available SDK's

      — commented June 16th 2010 by David Ashwood
  • I have a (simple) beta version of an android module here: https://github.com/bkurzius/Titanium-Android-AdMob-Module.

    I posted more info about it here: http://developer.appcelerator.com/question/119673/admob-for-android. Any android devs, please feel free to help improve it!

    — answered June 7th 2011 by brian kurzius
    permalink
    6 Comments
    • This looks SWEET! May your next app bring you fame and fortune and loose women :)

      — commented June 7th 2011 by Steve Hovey
    • Thanks Steve. Please let me know if you runs into any issues. I have also sent it to Appcelerator and hope someone there can give it a quick look…

      — commented June 7th 2011 by brian kurzius
    • I will. I had to adjust it for a windows build, but the test worked fine. I couldn't get my head around the module business - this is a twofer for me because it gives a good example of interfacing with a 3rd part library!

      — commented June 7th 2011 by Steve Hovey
    • Glad it worked. This was my first module – I had a critical need for this for a client's app so I did a crash course on Android last week with this book: http://oreilly.com/catalog/0636920010883/ and then followed the Titanium tutorial on modules. But I know that I still need a lot more practice…

      — commented June 7th 2011 by brian kurzius
    • Hi Steve,
      Just a heads up. I have just uploaded new code to GitHib. There are numerous improvements, including the ability to call ads at anytime – even test ads. You can get more details in the example – and in the documentation folder…

      — commented June 9th 2011 by brian kurzius
    • YOU ROCK!

      — commented June 9th 2011 by Steve Hovey
  • I have an implementation of AdMob working in my iPhone app, but I have not yet submitted it for approval. I am concerned, given what I've read the last few days regarding another Apple TOS change that basically "bans AdMob". Had anyone attempted a Ti module to support iAd?

    — answered June 14th 2010 by karlo kilayko
    permalink
    4 Comments
    • How did you get admob working, did you trick the Admob server to serve via webview? or just rewrite the sdk they provide?

      — commented June 15th 2010 by Ryan Tregea
    • Basically what you said: I have a webview which loads up a web implementation of AdMob. I grab any click events on the webview and expand it to a full screen webview that displays whatever AdMob links to. Like I said, I haven't even attempted to submit this yet. I will probably trash it and see how the iAd support works in Ti 1.4 ;)

      — commented June 23rd 2010 by karlo kilayko
    • how do you grab the click with the webview, but allow it to pass on to the admob ad as well? It's killing me! thanks, David

      — commented August 30th 2010 by david hoare
    • Karlo, Can you provide me sample code for ad integration? i am looking for integrate admob ad provider my application. Thanks.

      — commented January 3rd 2011 by suresh nariya
  • My Question

    I asked about admob the other day, I was specifically talking android. However perhaps the devs could tell us about whether their module API solution will support iAd for you.

    — answered June 15th 2010 by Ryan Tregea
    permalink
    0 Comments
  • Me too, I have been waiting for this 'feature'. According to the developers of ti, it is in the roadmap for future release of Ti SDK.

    Right now, I can only wait as current work-arounds are a bit tedious to implement plus may break Apple TOS.

    Since Apple coming up with iAds, I wonder if Ti will support it directly in the Ti mobile SDK….

    — answered June 15th 2010 by Peter Lum
    permalink
    0 Comments
  • Thanks for linking that David. Worked Perfectly. It's Great
    Perhaps Appcelerator will Put it in straight away.

    For those who haven't been following - David's Appcelerator Plugin

    1) You can grab a full 1.3.1 with Admob Plugin from

    http://CrucialDivide.com/mobilesdk-1.3.1-linux.zip

    2) Read his code at:

    http://gist.github.com/439986

    — answered June 22nd 2010 by Ryan Tregea
    permalink
    1 Comment
    • Cool. Thanks for trying it out Ryan.
      Let me know if you have any issues or feedback about the API david [at] CrucialDivide[dot]com.

      — commented June 22nd 2010 by David Ashwood
  • Does this approach work with Titanium SDK 1.4.0?

    — answered November 7th 2010 by Justin Toth
    permalink
    1 Comment
    • Tested this out on 1.4.0 and it doesn't work, it crashes the app. :(

      — commented November 7th 2010 by Justin Toth
  • This approach can't support on Titanium SDK1.6.1.

    I Hope the Titanium can Integrate the Admob quickly!

    Ref1: Admob for iPhone
    http://developer.admob.com/wiki/IPhone

    • This document described, I can use "new_windos: true" to control it.

    Ref2: Admob for Android
    http://developer.admob.com/wiki/Android

    • But on the Android hasn't the "new_windos: true" method.

    Does anyone have any solution on it? I want to detect the "Click AdMob Banner" behavior to open on new window for Android.

    Thank you!

    — answered March 19th 2011 by Potato Hwang
    permalink
    0 Comments
  • I suspect they are lighter on android/java programmers than ipod ones.. but you would think someone could slap together a wrapper.. I may take a stab at it although I dont know what Im going.. Suppose it would be a good way to learn!

    — answered June 5th 2011 by Steve Hovey
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.