Android Question AdMob problems....

Discussion in 'Android Questions' started by kepler, Jun 14, 2015.

  1. kepler

    kepler Active Member Licensed 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:

    Code:
    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, 0dip100%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
     
  2. NJDude

    NJDude Expert Licensed User

    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.
     
    thedesolatesoul likes this.
  3. kepler

    kepler Active Member Licensed 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
     
Loading...