This library requires some configuration. Please see the tutorial: http://www.b4x.com/forum/basic4andr...-admob-tutorial-add-ads-your-application.html
Reference: Basic4android - AdMob
AdMob v2.00 - Based on Google Play Services. This version requires B4A v3.20.
AdMob v1.40 - Add support for SIZE_SMART_BANNER.
These ads will fill the whole available width: https://developers.google.com/mobile-ads-sdk/docs/admob/smart-banners
You can use the following code:
See this post for an additional requirement if using google play services v28: https://www.b4x.com/android/forum/threads/admob-library.7301/page-10#post-381519
Reference: Basic4android - AdMob
AdMob v2.00 - Based on Google Play Services. This version requires B4A v3.20.
AdMob v1.40 - Add support for SIZE_SMART_BANNER.
These ads will fill the whole available width: https://developers.google.com/mobile-ads-sdk/docs/admob/smart-banners
You can use the following code:
B4X:
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 - height, 100%x, height)
See this post for an additional requirement if using google play services v28: https://www.b4x.com/android/forum/threads/admob-library.7301/page-10#post-381519
Attachments
Last edited: