Pendrush Well-Known Member Licensed User Longtime User Nov 20, 2019 #1 Do we have support for Adaptive Banners in AdMob? More info: https://developers.google.com/admob/android/banner/adaptive
Do we have support for Adaptive Banners in AdMob? More info: https://developers.google.com/admob/android/banner/adaptive
Erel B4X founder Staff member Licensed User Longtime User Nov 20, 2019 #2 Yes. 1: Code: Sub GetAdaptiveAdSize As AdSize Dim ctxt As JavaObject ctxt.InitializeContext Dim AdSize As JavaObject Dim width As Int = 100%x / GetDeviceLayoutValues.Scale Dim res As AdSize res.Native = AdSize.InitializeStatic("com.google.android.gms.ads.AdSize").RunMethod("getCurrentOrientationAnchoredAdaptiveBannerAdSize", Array(ctxt, width)) Dim jo As JavaObject = res.Native res.Width = jo.RunMethod("getWidthInPixels", Array(ctxt)) res.Height = jo.RunMethod("getHeightInPixels", Array(ctxt)) Return res End Sub 2: Add to Process_Globals Code: Type AdSize (Native As Object, Width As Int, Height As Int) 3. Usage: Code: Dim size As AdSize = GetAdaptiveAdSize adview1.Initialize2("ad", "ca-app-pub-126753333333/948333333", size.Native) Activity.AddView(adview1, 0, 0, size.Width, size.Height) Upvote 0
Yes. 1: Code: Sub GetAdaptiveAdSize As AdSize Dim ctxt As JavaObject ctxt.InitializeContext Dim AdSize As JavaObject Dim width As Int = 100%x / GetDeviceLayoutValues.Scale Dim res As AdSize res.Native = AdSize.InitializeStatic("com.google.android.gms.ads.AdSize").RunMethod("getCurrentOrientationAnchoredAdaptiveBannerAdSize", Array(ctxt, width)) Dim jo As JavaObject = res.Native res.Width = jo.RunMethod("getWidthInPixels", Array(ctxt)) res.Height = jo.RunMethod("getHeightInPixels", Array(ctxt)) Return res End Sub 2: Add to Process_Globals Code: Type AdSize (Native As Object, Width As Int, Height As Int) 3. Usage: Code: Dim size As AdSize = GetAdaptiveAdSize adview1.Initialize2("ad", "ca-app-pub-126753333333/948333333", size.Native) Activity.AddView(adview1, 0, 0, size.Width, size.Height)
asales Expert Licensed User Longtime User Nov 20, 2019 #3 Erel said: 3. Usage: Code: Dim size As AdSize = GetAdaptiveAdSize adview1.Initialize2("ad", "ca-app-pub-126753333333/948333333", size.Native) Activity.AddView(adview1, 0, 0, size.Width, size.Height) Click to expand... And this line: Code: adview1.LoadAd Upvote 0
Erel said: 3. Usage: Code: Dim size As AdSize = GetAdaptiveAdSize adview1.Initialize2("ad", "ca-app-pub-126753333333/948333333", size.Native) Activity.AddView(adview1, 0, 0, size.Width, size.Height) Click to expand... And this line: Code: adview1.LoadAd
DonManfred Expert Licensed User Longtime User Nov 20, 2019 #4 4. Minversion of Artifact: 18.3.0 Solution: Start B4ASDKManager and download all recommended items. Upvote 0
J joaomoraes83 Member Licensed User Longtime User Jan 12, 2020 #5 DonManfred said: 4. Minversion of Artifact: 18.3.0 Solution: Start B4ASDKManager and download all recommended items. Click to expand... Would you be able to indicate which of the recommended below I should do? Upvote 0
DonManfred said: 4. Minversion of Artifact: 18.3.0 Solution: Start B4ASDKManager and download all recommended items. Click to expand... Would you be able to indicate which of the recommended below I should do?
Jorge M A Well-Known Member Licensed User Longtime User Jan 12, 2020 #6 DonManfred said: download all recommended items Click to expand... All of them. Then repeat B4ASDKManager, till no more recommendations. Upvote 0
DonManfred said: download all recommended items Click to expand... All of them. Then repeat B4ASDKManager, till no more recommendations.
J joaomoraes83 Member Licensed User Longtime User Jan 13, 2020 #7 I installed the recommendations but problem persists. I am using the ready to use SDK. Is the adaptive banner only available for V9.5 +? Upvote 0
I installed the recommendations but problem persists. I am using the ready to use SDK. Is the adaptive banner only available for V9.5 +?
DonManfred Expert Licensed User Longtime User Jan 14, 2020 #8 joaomoraes83 said: I installed the recommendations but problem persists. Click to expand... Which problem? I don´t see you posted it in this thread!? If you have a problem then i suggest to start a new thread for your Issue, post all relevant code, and the FULL ERROR you got (as TEXT). Upvote 0
joaomoraes83 said: I installed the recommendations but problem persists. Click to expand... Which problem? I don´t see you posted it in this thread!? If you have a problem then i suggest to start a new thread for your Issue, post all relevant code, and the FULL ERROR you got (as TEXT).
P pemulanih Member Mar 12, 2021 #10 sorry solved ? B4X: Activity.AddView(adview1, 0, 90%y, size.Width, size.Height) Upvote 0
Pendrush Well-Known Member Licensed User Longtime User Mar 13, 2021 #11 pemulanih said: sorry solved ? B4X: Activity.AddView(adview1, 0, 90%y, size.Width, size.Height) Click to expand... Your code is wrong, as you assume that ad height is 10%y. Code should be like: B4X: Activity.AddView(adview1, 0, 100%y-size.Height, size.Width, size.Height) Upvote 0
pemulanih said: sorry solved ? B4X: Activity.AddView(adview1, 0, 90%y, size.Width, size.Height) Click to expand... Your code is wrong, as you assume that ad height is 10%y. Code should be like: B4X: Activity.AddView(adview1, 0, 100%y-size.Height, size.Width, size.Height)
P pemulanih Member Mar 17, 2021 #12 Pendrush said: Your code is wrong, as you assume that ad height is 10%y. Code should be like: B4X: Activity.AddView(adview1, 0, 100%y-size.Height, size.Width, size.Height) Click to expand... ohh ok thx master ....? Upvote 0
Pendrush said: Your code is wrong, as you assume that ad height is 10%y. Code should be like: B4X: Activity.AddView(adview1, 0, 100%y-size.Height, size.Width, size.Height) Click to expand... ohh ok thx master ....?