Dismiss Notice

REGISTRATION IS AFTER ADMIN ACTIVATION

DONATIONS WITH PAYPAL CLICK TO BUTTON

1 MONTH VIP - 5$; 3 MONTHS VIP - 10$; 6 MONTHS VIP - 20$; 1 YEAR VIP - 30$; 2 YEARS VIP - 50$; GOLD USER FOR LIFE VIP - 150$

DONATIONS WITH Bitcoin Address:3NRs3CK3fhXifrNYxHEZKpETDd9vNLMsMD

Dismiss Notice
The registration is approved by the Administrator. It takes about 1 day to approve your registration
Dismiss Notice
For open hidden message no need write thanks, thank etc. Enough is click to like button on right side of thread.

Using AdMob in an Android Delphi app

Discussion in 'Delphi Android And IOS' started by N0body, May 16, 2014.

  1. N0body
    Online

    N0bodyN0body is a Verified Member DelphiFan Administrator Staff Member DF Staff

    After the release of Delphi XE6, with mobile advertising support, I've made some experiments by adding advertising to a published Play Store application, my son's Lego minifigures app (you can find the app at play.google.com/store/apps/details and read about it on my blog at blog.marcocantu.com/blog/splash_screen_delphi_android.html and blog.marcocantu.com/blog/2014_march_mobile_update.html).

    What did it take me to add advertising? Dropping a BannerAd component and aligning it ot the bottom of a form is rather simple:


    Code:
    object BannerAd1: TBannerAd
      Align = MostBottom
    end

    Here is the bottom part of the form at design time:

    [​IMG]

    Next I added code in the form OnShow event handler, making sure it is executed only once:

    Code:
    if BannerAd1.AdUnitID = '' then 
          begin
             BannerAd1.AdUnitID := 'ca-app-pub-xxxxxxxxxxx1234567890';
             BannerAd1.LoadAd;

    Truly, the banner is displayed on top of the other form, so I have to adjust the other two forms to make room, something you can do with more banner ad components (which could potentially show different ads) or a panel or any other "spacer". So in terms of code, this is rather simple. Still you have to add one extra line to your Android manifest file, to indicate you have also an "advertising activity" as part of your app.

    That's it. Well, if you exclude the hour or so taht took me to create an AdMob account, a Wallet account, send banking and tax information, and quite a few other ancillary operations. Nothing technical in nature. The net result, you'll receive the "ad unit id" code to add to your application. This is a code unique for the ad unit and the specific application, and can be used for tracking the outcome of different ads. So, while there was some work involved, nothing really very difficult.

    This is a sample of the running application with some advertising (for Clash of Clans) showing at the bottom and some of the Lego Movie minifigures above:


    [​IMG]

    Now as a general comment, once I implemented advertising the app required extra permissions for Internet access (yes, this is another step you have to consider). While generally the update rate is very high (because updates are automatic) with the new permission the update required user approval, and the upgrade rate dropped considerably. So out of current 30,000 users who have the application installed (yes, quite impressive given it does very little, you wait 30 minutes and get a new minifigure, that's all) only about 7,000 got on the new version with advertising over the last 4 weeks.

    Now, you might wonder, was it worth the effort and is there any real money in mobile advertising? Yes and yes. I was expecting this very focused and particular app will make a few dollars a month, like the advertising I have on some of my web sites. But I was wrong. Take my expectations... and multiply by 20 or 50. Here is a report for the app, I'll let you wonder which is the associated time period!

    [​IMG]
     

Share This Page

Laws
Our website, law, laws, copyright and aims to be respectful of individual rights. Our site, as defined in the law of 5651 serves as a provider of space. According to the law, contrary to the law of site management has no obligation to monitor content. Therefore, our site has adopted the principle of fit and remove. Works are subject to copyright laws and is shared in a manner that violated their legal rights, or professional associations, rights holders who, adsdelphi@gmail.com I can reach us at e-mail address. Complaints considered to be infringing on the examination of the content will be removed from our site.
Donate Help To Us and Be VIP
DONATIONS WITH PAYPAL CLICK TO BUTTON
6 MONTHS VIP - 20$; 1 YEAR VIP - 30$; 2 YEARS VIP - 50$; GOLD USER FOR LIFE VIP - 150$
Social Block