Jan 1, 2021 Replies: 36 FirebaseAdmobPlus is no longer supported, please check out GoogleMobileAds lib https://www.b4x.com/android/forum/threads/googlemobileadssdk.128787/ Hi This is a full wrapper over goolgle ads sdk. https://developers.google.com/admob/android/quick-start It supports : - Banner (Also Adaptive Banner) | https://developers.google.com/admob/android/banner - Interstitial | https://developers.google.com/admob/android/interstitial - Rewerded | https://developers.google.com/admob/android/rewarded-ads - AppOpenAds | https://developers.google.com/admob/android/app-open-ads - UnifiedNative | https://developers.google.com/android/reference/com/google/android/gms/ads/formats/UnifiedNativeAd First you need to follow the Firebase integration tutorial: https://www.b4x.com/android/forum/threads/integrating-firebase-services.67692/ Make sure to include the Ads manifest snippet. Note: - This library is compatible with Admob version 19.6 or higher, So if you see any errors, please update your SDK first. - This library will be updated as soon as Google launches the new Google Mobile Ads SDK for Android version 20.0.0 In early 2021. So several APIs currently available will be changed or retired. See this https://developers.google.com/admob/android/migration - You should initialialize MobileSdk at first once and wait for MobileAds_onInitializationComplete then you can add your ads. like this: B4X: Expand Collapse Copy Dim MobileAds As MobileAds MobileAds.Initialize Wait For MobileAds_onInitializationComplete ' Here You Can Load Your Ads - For video ads to show successfully in your banner ad views, hardware acceleration must be enabled.(Add to manifest) B4X: Expand Collapse Copy SetApplicationAttribute(android:hardwareAccelerated, "true") - By default, the Google Mobile Ads SDK initializes app measurement and begins sending user-level event data to Google immediately when the app starts. This initialization behavior ensures you can enable AdMob user metrics without making additional code changes. However, if your app requires user consent before these events can be sent, you can delay app measurement until you explicitly initialize the Mobile Ads SDK or load an ad. To delay app measurement, add the following <meta-data> tag in your Manifest. Delay app measurement until MobileAds.initialize() is called. B4X: Expand Collapse Copy AddApplicationText( <meta-data android:name="com.google.android.gms.ads.DELAY_APP_MEASUREMENT_INIT" android:value="true"/> ) Attachments FirebaseAdmobPlus.jar FirebaseAdmobPlus.jar 57.7 KB · Views: 938 FirebaseAdmobPlus.xml FirebaseAdmobPlus.xml 73.1 KB · Views: 833 Example.zip Example.zip 15.1 KB · Views: 995 Last edited: Mar 18, 2021 Click to expand...
FirebaseAdmobPlus is no longer supported, please check out GoogleMobileAds lib https://www.b4x.com/android/forum/threads/googlemobileadssdk.128787/ Hi This is a full wrapper over goolgle ads sdk. https://developers.google.com/admob/android/quick-start It supports : - Banner (Also Adaptive Banner) | https://developers.google.com/admob/android/banner - Interstitial | https://developers.google.com/admob/android/interstitial - Rewerded | https://developers.google.com/admob/android/rewarded-ads - AppOpenAds | https://developers.google.com/admob/android/app-open-ads - UnifiedNative | https://developers.google.com/android/reference/com/google/android/gms/ads/formats/UnifiedNativeAd First you need to follow the Firebase integration tutorial: https://www.b4x.com/android/forum/threads/integrating-firebase-services.67692/ Make sure to include the Ads manifest snippet. Note: - This library is compatible with Admob version 19.6 or higher, So if you see any errors, please update your SDK first. - This library will be updated as soon as Google launches the new Google Mobile Ads SDK for Android version 20.0.0 In early 2021. So several APIs currently available will be changed or retired. See this https://developers.google.com/admob/android/migration - You should initialialize MobileSdk at first once and wait for MobileAds_onInitializationComplete then you can add your ads. like this: B4X: Expand Collapse Copy Dim MobileAds As MobileAds MobileAds.Initialize Wait For MobileAds_onInitializationComplete ' Here You Can Load Your Ads - For video ads to show successfully in your banner ad views, hardware acceleration must be enabled.(Add to manifest) B4X: Expand Collapse Copy SetApplicationAttribute(android:hardwareAccelerated, "true") - By default, the Google Mobile Ads SDK initializes app measurement and begins sending user-level event data to Google immediately when the app starts. This initialization behavior ensures you can enable AdMob user metrics without making additional code changes. However, if your app requires user consent before these events can be sent, you can delay app measurement until you explicitly initialize the Mobile Ads SDK or load an ad. To delay app measurement, add the following <meta-data> tag in your Manifest. Delay app measurement until MobileAds.initialize() is called. B4X: Expand Collapse Copy AddApplicationText( <meta-data android:name="com.google.android.gms.ads.DELAY_APP_MEASUREMENT_INIT" android:value="true"/> )
ArminKh1993 Active Member Feb 2, 2021 #21 SMOOTSARA said: HI ArminKh1993 ? Thank you for a good library? There is a small bug in the "IsLoaded" control time Returns the value "null" but the default should be "false" Please test the following codes B4X: Expand Collapse Copy InterstitialAd.Initialize("InterstitialAd") Log(InterstitialAd.IsLoaded) If InterstitialAd.IsLoaded = True Then Log("InterstitialAd Is Loaded and go to show ad") Else InterstitialAd.LoadAdWithBuilder(xxx,builder) End If B4X: Expand Collapse Copy java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.google.android.gms.ads.InterstitialAd.isLoaded()' on a null object reference Click to expand... I checked and this is being returned by Google SDK itself. In any case, if the onAdLoaded event raised, it means that the ad is loaded and you do not need to check again. But, I will try to resolve this issue manually with the new Google update that will be released soon.
SMOOTSARA said: HI ArminKh1993 ? Thank you for a good library? There is a small bug in the "IsLoaded" control time Returns the value "null" but the default should be "false" Please test the following codes B4X: Expand Collapse Copy InterstitialAd.Initialize("InterstitialAd") Log(InterstitialAd.IsLoaded) If InterstitialAd.IsLoaded = True Then Log("InterstitialAd Is Loaded and go to show ad") Else InterstitialAd.LoadAdWithBuilder(xxx,builder) End If B4X: Expand Collapse Copy java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.google.android.gms.ads.InterstitialAd.isLoaded()' on a null object reference Click to expand... I checked and this is being returned by Google SDK itself. In any case, if the onAdLoaded event raised, it means that the ad is loaded and you do not need to check again. But, I will try to resolve this issue manually with the new Google update that will be released soon.
SMOOTSARA Active Member Licensed User Longtime User Feb 14, 2021 #22 Hi ArminKh1993 ? I installed your sample But I have the following error in the "AppOpenAds" section B4X: Expand Collapse Copy ** Activity (main) Pause, UserClosed = false ** ** Activity (actappopenads) Create, isFirst = true ** ** Activity (actappopenads) Resume ** AppOpenAds_onAppOpenAdLoaded 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/b4a.remote.config-1/base.apk) at com.b4a.admobwrapper.AppOpenAdsWrapper.Show(AppOpenAdsWrapper.java:117) at b4a.remote.config.actappopenads._appopenads_onappopenadloaded(actappopenads.java:474) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732) at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348) at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144) at anywheresoftware.b4a.BA$2.run(BA.java:387) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6138) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:893) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:783) ** Activity (actappopenads) Pause, UserClosed = true ** ** Activity (main) Resume ** ** Activity (main) Pause, UserClosed = true ** ** Service (starter) Destroy (ignored)** And i update 2. Android SDK + Required Resources in https://www.b4x.com/b4a.html
Hi ArminKh1993 ? I installed your sample But I have the following error in the "AppOpenAds" section B4X: Expand Collapse Copy ** Activity (main) Pause, UserClosed = false ** ** Activity (actappopenads) Create, isFirst = true ** ** Activity (actappopenads) Resume ** AppOpenAds_onAppOpenAdLoaded 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/b4a.remote.config-1/base.apk) at com.b4a.admobwrapper.AppOpenAdsWrapper.Show(AppOpenAdsWrapper.java:117) at b4a.remote.config.actappopenads._appopenads_onappopenadloaded(actappopenads.java:474) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732) at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348) at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144) at anywheresoftware.b4a.BA$2.run(BA.java:387) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6138) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:893) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:783) ** Activity (actappopenads) Pause, UserClosed = true ** ** Activity (main) Resume ** ** Activity (main) Pause, UserClosed = true ** ** Service (starter) Destroy (ignored)** And i update 2. Android SDK + Required Resources in https://www.b4x.com/b4a.html
mcqueccu Expert Licensed User Longtime User Feb 14, 2021 #23 SMOOTSARA said: Hi ArminKh1993 ? I installed your sample But I have the following error in the "AppOpenAds" section B4X: Expand Collapse Copy ** Activity (main) Pause, UserClosed = false ** ** Activity (actappopenads) Create, isFirst = true ** ** Activity (actappopenads) Resume ** AppOpenAds_onAppOpenAdLoaded 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/b4a.remote.config-1/base.apk) at com.b4a.admobwrapper.AppOpenAdsWrapper.Show(AppOpenAdsWrapper.java:117) at b4a.remote.config.actappopenads._appopenads_onappopenadloaded(actappopenads.java:474) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732) at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348) at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144) at anywheresoftware.b4a.BA$2.run(BA.java:387) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6138) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:893) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:783) ** Activity (actappopenads) Pause, UserClosed = true ** ** Activity (main) Resume ** ** Activity (main) Pause, UserClosed = true ** ** Service (starter) Destroy (ignored)** And i update 2. Android SDK + Required Resources in https://www.b4x.com/b4a.html View attachment 108003 View attachment 108004 Click to expand... Check post number 11. https://www.b4x.com/android/forum/threads/firebaseadmobplus.126078/post-789111 You need to update the admob sdk to 19.6.0 through the sdkmanager
SMOOTSARA said: Hi ArminKh1993 ? I installed your sample But I have the following error in the "AppOpenAds" section B4X: Expand Collapse Copy ** Activity (main) Pause, UserClosed = false ** ** Activity (actappopenads) Create, isFirst = true ** ** Activity (actappopenads) Resume ** AppOpenAds_onAppOpenAdLoaded 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/b4a.remote.config-1/base.apk) at com.b4a.admobwrapper.AppOpenAdsWrapper.Show(AppOpenAdsWrapper.java:117) at b4a.remote.config.actappopenads._appopenads_onappopenadloaded(actappopenads.java:474) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732) at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348) at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144) at anywheresoftware.b4a.BA$2.run(BA.java:387) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6138) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:893) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:783) ** Activity (actappopenads) Pause, UserClosed = true ** ** Activity (main) Resume ** ** Activity (main) Pause, UserClosed = true ** ** Service (starter) Destroy (ignored)** And i update 2. Android SDK + Required Resources in https://www.b4x.com/b4a.html View attachment 108003 View attachment 108004 Click to expand... Check post number 11. https://www.b4x.com/android/forum/threads/firebaseadmobplus.126078/post-789111 You need to update the admob sdk to 19.6.0 through the sdkmanager
SMOOTSARA Active Member Licensed User Longtime User Feb 15, 2021 #24 mcqueccu said: Check post number 11. https://www.b4x.com/android/forum/threads/firebaseadmobplus.126078/post-789111 You need to update the admob sdk to 19.6.0 through the sdkmanager Click to expand... HI mcqueccu Where can I see the number of this version? I just found this
mcqueccu said: Check post number 11. https://www.b4x.com/android/forum/threads/firebaseadmobplus.126078/post-789111 You need to update the admob sdk to 19.6.0 through the sdkmanager Click to expand... HI mcqueccu Where can I see the number of this version? I just found this
mcqueccu Expert Licensed User Longtime User Feb 15, 2021 #25 You need to download everything new. Sdk manager at instructions 2 B4A – The simple way to develop native Android apps B4A includes all the features needed to quickly develop any type of Android app. B4A is used by tens of thousands of developers from all over the world, including companies such as NASA, HP, IBM and others. www.b4x.com
You need to download everything new. Sdk manager at instructions 2 B4A – The simple way to develop native Android apps B4A includes all the features needed to quickly develop any type of Android app. B4A is used by tens of thousands of developers from all over the world, including companies such as NASA, HP, IBM and others. www.b4x.com
ArminKh1993 Active Member Feb 15, 2021 #26 SMOOTSARA said: HI mcqueccu Where can I see the number of this version? I just found this View attachment 108018 Click to expand... Please read the first post carefully before using the library. anyway, start SDK Manager and in search field type play-service-ads and install it.
SMOOTSARA said: HI mcqueccu Where can I see the number of this version? I just found this View attachment 108018 Click to expand... Please read the first post carefully before using the library. anyway, start SDK Manager and in search field type play-service-ads and install it.
Jack Cole Well-Known Member Licensed User Longtime User Mar 6, 2021 #27 Great work on this library. Any chance you could ad rewarded interstitial? It is different from the regular rewarded video ad. Rewarded interstitial ads (beta) | Android | Google for Developers Implement rewarded interstitial ads for an ad experience with rewards using Google Mobile Ads SDK (Legacy) for Android. developers.google.com
Great work on this library. Any chance you could ad rewarded interstitial? It is different from the regular rewarded video ad. Rewarded interstitial ads (beta) | Android | Google for Developers Implement rewarded interstitial ads for an ad experience with rewards using Google Mobile Ads SDK (Legacy) for Android. developers.google.com
ArminKh1993 Active Member Mar 7, 2021 #28 Jack Cole said: Great work on this library. Any chance you could ad rewarded interstitial? It is different from the regular rewarded video ad. Rewarded interstitial ads (beta) | Android | Google for Developers Implement rewarded interstitial ads for an ad experience with rewards using Google Mobile Ads SDK (Legacy) for Android. developers.google.com Click to expand... I wrapped it but still i'm waiting for google ads sdk v20 to release
Jack Cole said: Great work on this library. Any chance you could ad rewarded interstitial? It is different from the regular rewarded video ad. Rewarded interstitial ads (beta) | Android | Google for Developers Implement rewarded interstitial ads for an ad experience with rewards using Google Mobile Ads SDK (Legacy) for Android. developers.google.com Click to expand... I wrapped it but still i'm waiting for google ads sdk v20 to release
Jack Cole Well-Known Member Licensed User Longtime User Mar 7, 2021 #29 They say it works with 19.2+.
ArminKh1993 Active Member Mar 8, 2021 #30 Jack Cole said: They say it works with 19.2+. Click to expand... As i said at first post: This library will be updated as soon as Google launches the new Google Mobile Ads SDK for Android version 20.0.0 In early 2021. So several APIs currently available will be changed or retired. See this https://developers.google.com/admob/android/migration
Jack Cole said: They say it works with 19.2+. Click to expand... As i said at first post: This library will be updated as soon as Google launches the new Google Mobile Ads SDK for Android version 20.0.0 In early 2021. So several APIs currently available will be changed or retired. See this https://developers.google.com/admob/android/migration
asales Expert Licensed User Longtime User Mar 18, 2021 #31 ArminKh1993 said: This library will be updated as soon as Google launches the new Google Mobile Ads SDK for Android version 20.0.0 In early 2021. So several APIs currently available will be changed or retired. See this https://developers.google.com/admob/android/migration Click to expand... When you updated this lib, please, rename the Adview (banner) component to AdviewPlus or other name. I use the Adview banner from the original Admob lib from Erel and I get a conflict with this lib when I try to use the AppOpenAd. Thanks.
ArminKh1993 said: This library will be updated as soon as Google launches the new Google Mobile Ads SDK for Android version 20.0.0 In early 2021. So several APIs currently available will be changed or retired. See this https://developers.google.com/admob/android/migration Click to expand... When you updated this lib, please, rename the Adview (banner) component to AdviewPlus or other name. I use the Adview banner from the original Admob lib from Erel and I get a conflict with this lib when I try to use the AppOpenAd. Thanks.
ArminKh1993 Active Member Mar 18, 2021 #32 asales said: When you updated this lib, please, rename the Adview (banner) component to AdviewPlus or other name. I use the Adview banner from the original Admob lib from Erel and I get a conflict with this lib when I try to use the AppOpenAd. Thanks. Click to expand... Open xml file of library and rename ìt by yourself
asales said: When you updated this lib, please, rename the Adview (banner) component to AdviewPlus or other name. I use the Adview banner from the original Admob lib from Erel and I get a conflict with this lib when I try to use the AppOpenAd. Thanks. Click to expand... Open xml file of library and rename ìt by yourself
Jack Cole Well-Known Member Licensed User Longtime User May 5, 2021 #33 Hi ArminKh1993. Are you planning to update this library for v20+? Thank you.
Erel B4X founder Staff member Licensed User Longtime User May 5, 2021 #34 I recommend you to use AdsHelper extends FirebaseAdMob2 / Google Mobile Ads v20.0 It can be extended quite easily to support more types of ads.
I recommend you to use AdsHelper extends FirebaseAdMob2 / Google Mobile Ads v20.0 It can be extended quite easily to support more types of ads.
Jack Cole Well-Known Member Licensed User Longtime User May 5, 2021 #35 I looked at it, but it doesn't have Rewarded Video Ads and Unified Native Ads.
ArminKh1993 Active Member May 5, 2021 #36 Jack Cole said: Hi ArminKh1993. Are you planning to update this library for v20+? Thank you. Click to expand... see top of first post there is a link to my new library named GoogleMobileAds which support all available type of admob ads with support v20+
Jack Cole said: Hi ArminKh1993. Are you planning to update this library for v20+? Thank you. Click to expand... see top of first post there is a link to my new library named GoogleMobileAds which support all available type of admob ads with support v20+
Jack Cole Well-Known Member Licensed User Longtime User May 6, 2021 #37 Thank you! Sorry, I missed that!