I was trying to implement AdMob in one of my apps. I have the Ad unit name, and the Ad unit ID already.
I've implemented the code given in this forum, using the AdMob lib available for download. As for the dependecy libs, I've downloaded the Google Play services and repository.
So the code goes something like this:
B4X:
Dim Adview1 As AdView
...
'AdMob
Adview1.Initialize2("Adunitname", "adunitid", 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)
'End AdMob
The problem is that nothing is showing up... I get no errors - apparently - but no ad appears.
Can someone help me out? Maybe I'm missing a lib - but an error would be expected...
I would recommend you use the "SIZE_BANNER" using the Smart banner takes too much real estate and you have to get the EXACT size otherwise the ads won't show.
Well, the problem was residing in the API Android level of B4A - I was using the standard 8 as the manual says. I just updated to 15.
I was expecting that the configuration was simplier; but we must really follow all the steps in the tutorial of the AdMob lib described in this forum here.