Android Question AdMob problems....

kepler

Active Member
Licensed User
Longtime User
Hi,

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...

Kind regards,

Kepler
 

kepler

Active Member
Licensed User
Longtime User
Hi,

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.

Problem solved...

Kind regards,

Kepler
 
Upvote 0
Top