Admob Interstitials Demo Source Code Using The Android JNI In Delphi XE5 Firemonkey

Delphi XE5 Firemonkey InterstitialDeveloper Sadettin Polat wrote in with a link to a demo he wrote which implements AdMob interstitials in Delphi XE5 Firemonkey. The demo is a good demonstration of using the Delphi Android JNI. In previous demos of using Admob with Delphi I’ve only seen banner ads demonstrated. One caveat is that Google Play may no longer be accepting applications with the original Admob SDK in them as of August 1st 2014. Google has a new Admob SDK which is part of the Google Play Services SDK. However, even if you can no longer use the SDK from this demo on Google Play it does give you a great starting point for converting it forward to the new Google Play Services Admob SDK. Google has a migration guide here that shows the differences between the two SDKs. Similar Android JNI code should work in Delphi XE6 and AppMethod. Here is a sample of the type section from the Admob interstitial demo:

Head over and check out the full source code for the Admob SDK interstitial demo on Github before downloading it.

Have Delphi Firemonkey questions? Ask and get answers on StackOverflow.

One Response to Admob Interstitials Demo Source Code Using The Android JNI In Delphi XE5 Firemonkey

  1. Daniel Tibúrcio Silva Filho says:

    I can preview an Admosb type ad if it does not click on a button but I can not in the OnCloseQuery event.
    I debugged the app a lot and I came to the conclusion that the commands are called and executed by both the button and the FormCloseQuery, but in the latter case it does not show the Interstitial ad and by the button it is shown. The commands are:

    procedure.
    var
       LADRequestBuilder: JAdRequest_Builder;
       LadRequest: JAdRequest;
    begin
       LADRequestBuilder: = TJAdRequest_Builder.Create;
       LADRequestBuilder.addTestDevice (MainActivity.getDeviceID);
       LadRequest: = LADRequestBuilder.build ();
       LAdViewListener: = TMyAdViewListener.Create (FInterStitial);
       CallInUIThread (
         procedure
         begin
           FInterStitial.setAdListener (TJAdListenerAdapter.JavaClass.init
             (LAdViewListener));
           FInterStitial.loadAd (LadRequest);
         end);
    end;

    Is there any restriction on using these commands in FormCloseQuery, that is, in the output of the app?

Leave a Reply to Daniel Tibúrcio Silva Filho Cancel reply

Show Buttons
Hide Buttons
Read previous post:
Delphi Inspect System Parameters App In Delphi XE6 Firemonkey On Android, IOS, Windows, And OSX

Developer David Berneda has released an app called Delphi Inspect which displays all of the system parameters from Delphi XE6...

Close