D
Adview1.Initialize2("Ad", "xxxxxxxx", AdView1.SIZE_SMART_BANNER)
Dim height As Int
If GetDeviceLayoutValues.ApproximateScreenSize < 6 Then
'phones
If 100%x > 100%y Then height = 32dip Else height = 50dip
Else
'tablets
height = 90dip
End If
Activity.AddView(AdView1, 0dip, 100%y - (toolbar.height + height), 100%x, height)
With "AdView.SIZE_BANNER" the height is correct, but the width is too small.Did you have the same behavior using AdView.SIZE_BANNER instead of SMART_BANNER?
That makes no differenceTest with:
B4X:GetDeviceLayoutValues.ApproximateScreenSize < 6.5
Sub GetAddViewHeight As Int
Dim height As Int
If GetDeviceLayoutValues.ApproximateScreenSize < 6 Then
'phones
If 100%x > 100%y Then height = 32dip Else height = 50dip
Else
If 100%y > 100%x Then
'tablets
height = 90dip
Else
height = 50dip
End If
End If
Log("AddViewHeight=" & height)
Return height
End Sub
AddViewHeight=150
AddViewHeight=131
1920 / 2280 = 0.8421
131 / 150 = 0.8733
the difference is insignificant, the two banners have the same height, I think.
Check thetopbottom position.
So that it is correctly displayed correctly on the Nokia, I have to change the height to 90dip, is this normal?
Both displays are less than 6", so...So that it is correctly displayed correctly on the Nokia, I have to change the height to 90dip, is this normal?
so to get the same height you should change the height to 50dip rather than 90dip. Anyway, I still think they have the same height, 50dipIf GetDeviceLayoutValues.ApproximateScreenSize < 6 Then
'phones
If 100%x > 100%y Then height = 32dip Else height = 50dip
Should have the same height, but is not so. You can see it in this issue.Anyway, I still think they have the same height, 50dip
Code:
Sub GetAddViewHeight As Int
Dim height As Int
If GetDeviceLayoutValues.ApproximateScreenSize < 6 Then
'phones
If 100%x > 100%y Then height = 32dip Else height = 50dip
Else
If 100%y > 100%x Then
'tablets
height = 90dip
Else
height = 50dip
End If
End If
Log("AddViewHeight=" & height)
Return height
End Sub
Samsung A5(2017):
AddViewHeight=150
Nokia 7.1:
AddViewHeight=131
If I strictly follow the Google guidelines, then I have no suitable place for a banner.Filippo,
Did you even check the admob banner guidelines?
You'll risk to get your app removed or get banned with a design like that.
https://support.google.com/admob/answer/6275345?hl=en&ref_topic=2745287
unfortunately this does not solve my problem.https://www.b4x.com/android/forum/threads/layout-with-banner.86641/
Poi magari nel forum italiano ci dici quale sia il gioco... spero non il mio
Si tratta del mio unico gioco di carte Solitario.Poi magari nel forum italiano ci dici quale sia il gioco... spero non il mio
It works well for me. I use a panel as base, set its top and height based on the height of the banner (which depends on the device) and then load the layout into this base panel.unfortunately this does not solve my problem.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?