1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Donation with Paypal!!!

    Go to your paypal account and send directly donation to [email protected]

    1 month - 10 $ - Standart VIP

    6 months - 20 $- Standart VIP

    1 year - 30 $- Standart VIP

    2 years - 50 $- Standart VIP

    Gold member for life - 150 $- Standart VIP

    High Vip (Standart VIP include) group please send PM or email to [email protected] for info

    After Donation please send email to [email protected]

  3. Donation Ways 2020


    Paysend
  4. Telegram
Dismiss Notice

Donation with Paypal!!!

Go to your paypal account and send directly donation to [email protected]

1 month - 10 $ - Standart VIP

6 months - 20 $- Standart VIP

1 year - 30 $- Standart VIP

2 years - 50 $- Standart VIP

Gold member for life - 150 $- Standart VIP

High Vip (Standart VIP include) group please send PM or email to [email protected] for info

After Donation please send email to [email protected]

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 AdminDF, May 16, 2014.

  1. AdminDF
    Online

    AdminDFAdminDF is a Verified Member Delphifan 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