B4A Library Google App Open Ads

This is a wrapper of Google AppOpen Ads library for B4A. I made this for @Jack Cole and he gave me permission to post this in forum to help other users.

B4i wrapper is available here.

GADAppOpenAd

Author:
@Biswajit
Version: 1
  • GADAppOpenAd
    Google AppOpenAd.
    • Events:
      • AppOpenAd_Event (event As String)
    • Functions:
      • Initialize (callback As Object)
        Initializes the object on Activity_Create.
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • RequestAppOpenAd (adID As String)
        Request an ad for later use.
        Like you can call this after the user dismisses the first ad.
      • TryToPresentAppOpenAd (adID As String)
        Call this method on Application_Resume event.
        If there is no ad loaded then it will first load the ad then present the ad.
Installation: Copy the attached JAR and XML files to B4A additional library folder.
 

Attachments

  • GADAppOpenAd.xml
    2 KB · Views: 83
  • GADAppOpenAd_example.zip
    10.7 KB · Views: 86
  • GADAppOpenAd.jar
    4.3 KB · Views: 81

MarcoRome

Expert
Licensed User
Hi @Biswajit.
Thank you both for this new library.
When i try your example the app opens and after a few seconds it crashes with the following error:

*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
java.lang.NoSuchMethodError: No virtual method show(Landroid/app/Activity;Lcom/google/android/gms/ads/FullScreenContentCallback;)V in class Lcom/google/android/gms/ads/appopen/AppOpenAd; or its super classes (declaration of 'com.google.android.gms.ads.appopen.AppOpenAd' appears in /data/app/com.gad.test-_grSVwBdUErfHw3A72fBwA==/base.apk)
at com.gad.appopenad.gadappopenad.showAdIfAvailable(gadappopenad.java:142)
at com.gad.appopenad.gadappopenad$1.onAppOpenAdLoaded(gadappopenad.java:106)
at com.google.android.gms.internal.ads.zzsb.zza(com.google.android.gms:play-services-ads-lite@@19.3.0:6)
at com.google.android.gms.internal.ads.zzsh.zza(com.google.android.gms:play-services-ads-lite@@19.3.0:18)
at com.google.android.gms.internal.ads.zzgt.onTransact(com.google.android.gms:play-services-ads-base@@19.3.0:13)
at android.os.Binder.transact(Binder.java:612)
at gf.aY:)com.google.android.gms.policy_ads_fdr_dynamite@204204100@204204100000.336078696.336078696:2)
at com.google.android.gms.ads.nonagon.slot.appopen.n.a(Unknown Source:0)
at com.google.android.gms.ads.nonagon.slot.common.q.a:)com.google.android.gms.policy_ads_fdr_dynamite@204204100@204204100000.336078696.336078696:2)
at com.google.android.gms.ads.nonagon.slot.appopen.x.f:)com.google.android.gms.policy_ads_fdr_dynamite@204204100@204204100000.336078696.336078696:1)
at com.google.android.gms.ads.nonagon.slot.appopen.e.b:)com.google.android.gms.policy_ads_fdr_dynamite@204204100@204204100000.336078696.336078696:0)
at com.google.android.gms.ads.nonagon.slot.appopen.k.b:)com.google.android.gms.policy_ads_fdr_dynamite@204204100@204204100000.336078696.336078696:0)
at yt.run:)com.google.android.gms.policy_ads_fdr_dynamite@204204100@204204100000.336078696.336078696:6)
at com.google.android.gms.ads.internal.util.future.c.execute:)com.google.android.gms.policy_ads_fdr_dynamite@204204100@204204100000.336078696.336078696:2)
at com.google.android.gms.ads.internal.util.future.d.execute:)com.google.android.gms.policy_ads_fdr_dynamite@204204100@204204100000.336078696.336078696:0)
at xs.r:)com.google.android.gms.policy_ads_fdr_dynamite@204204100@204204100000.336078696.336078696:1)
at xs.m:)com.google.android.gms.policy_ads_fdr_dynamite@204204100@204204100000.336078696.336078696:8)
at xs.p:)com.google.android.gms.policy_ads_fdr_dynamite@204204100@204204100000.336078696.336078696:2)
at zk.run:)com.google.android.gms.policy_ads_fdr_dynamite@204204100@204204100000.336078696.336078696:9)
at ym.execute:)com.google.android.gms.policy_ads_fdr_dynamite@204204100@204204100000.336078696.336078696:0)
at xs.r:)com.google.android.gms.policy_ads_fdr_dynamite@204204100@204204100000.336078696.336078696:1)
at xs.m:)com.google.android.gms.policy_ads_fdr_dynamite@204204100@204204100000.336078696.336078696:8)
at xs.j:)com.google.android.gms.policy_ads_fdr_dynamite@204204100@204204100000.336078696.336078696:0)
at xv.a:)com.google.android.gms.policy_ads_fdr_dynamite@204204100@204204100000.336078696.336078696:0)
at xw.run:)com.google.android.gms.policy_ads_fdr_dynamite@204204100@204204100000.336078696.336078696:12)
at ym.execute:)com.google.android.gms.policy_ads_fdr_dynamite@204204100@204204100000.336078696.336078696:0)
at com.google.android.gms.ads.internal.util.future.d.execute:)com.google.android.gms.policy_ads_fdr_dynamite@204204100@204204100000.336078696.336078696:0)
at zd.execute:)com.google.android.gms.policy_ads_fdr_dynamite@204204100@204204100000.336078696.336078696:1)
at xs.r:)com.google.android.gms.policy_ads_fdr_dynamite@204204100@204204100000.336078696.336078696:1)
at xs.m:)com.google.android.gms.policy_ads_fdr_dynamite@204204100@204204100000.336078696.336078696:8)
at xs.j:)com.google.android.gms.policy_ads_fdr_dynamite@204204100@204204100000.336078696.336078696:0)
at zj.j:)com.google.android.gms.policy_ads_fdr_dynamite@204204100@204204100000.336078696.336078696:0)
at com.google.android.gms.ads.internal.util.future.j.e:)com.google.android.gms.policy_ads_fdr_dynamite@204204100@204204100000.336078696.336078696:0)
at com.google.android
Message longer than Log limit (4000). Message was truncated.
 

Biswajit

Active Member
Licensed User
Hi @Biswajit.
Thank you both for this new library.
When i try your example the app opens and after a few seconds it crashes with the following error:
Update google play service ads from SDK manager.
 
Top