Titanium Community Questions & Answer Archive

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

Issues with placing ads in Android app

I'm using AdMob to serve up ads at the bottom of each window of my Android app. I have a ad.js file that I include in each window:

var adUrl = "myadurl";

var adWebView = Ti.UI.createWebView({
    url: adUrl, /*opacity: 0.5,*/ zIndex: 20, 
    height: 55, bottom: 0, left: 0, right: 0, scalesPageToFit: true
});
win.add(adWebView);

This somewhat works. There are two issues though:

  1. Even though the ad fits perfectly at the bottom of the screen, the web view is adding a vertical scrollbar. Is there a way to disable this scrollbar while still allowing the user to click on the ad?
  2. When you click on the ad, it tries to open the location within the small webview. How do I make it open the ad in a web browser over top of my app?
— asked November 5th 2010 by Justin Toth
  • admob
  • ads
0 Comments

2 Answers

  • What you can better do is getting the onclick event of the webview and make it open a web browser with the url and then turn touchenabled on false.

    — answered November 5th 2010 by Peter Griffin
    permalink
    1 Comment
    • The problem though is that the webview contains a webpage that I host which contains an ad script. If I disable touch and have onclick trigger opening my url, it'll just go to my hosted webpage instead of the destination link of the specific ad…

      — commented November 5th 2010 by Justin Toth
  • Anyone else have ideas of how this can be done? I'm sure some of you have ads on your apps, right?

    — answered November 7th 2010 by Justin Toth
    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.