Android Question Admob for Adwords in B4A App

Discussion in 'Android Questions' started by Simon Smith, Mar 7, 2015.

  1. Simon Smith

    Simon Smith Active Member Licensed User

    Hello group,

    I have implemented the sample code, added my publisher ID, yet no banner shows. Does it only work when it is signed or something?


    Sub Ad
    Msgbox ("Ad","s")
    End Sub

    Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    'Activity.LoadLayout("Layout1")
    adview1.Initialize2("Ad", "pub-XXXXXXXXXXXXXX", 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 Sub
     
  2. walterf25

    walterf25 Well-Known Member Licensed User

    Normally it takes a few hours before you start seeing any live ads if you just signed up with them. Do you have the _OnLoad events and the _OnError events, if not you should add them to see if there's any errors.

    Hope this helps.
    Walter
     
  3. Simon Smith

    Simon Smith Active Member Licensed User

    Hi still no luck.

    I thought it might be the webview on top so I took it out and write straight to the Layout1
    It should go to the bottom.
    I've had Adsense for 5 or so years
    It works with my details. Do I need to take out the pub-
    Has anyone got the small banner working? Do you have to resize your layout to be smaller?


    Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("Layout1")
    adview1.Initialize2("Ad", "pub-XXXXXXXXXXXXX", 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)
    ' WebView1.SetLayout(0,0,Activity.width,Activity.height)
    End Sub

    Sub Activity_OnError
    'This is breakpointed

    End Sub

    Sub Activity_OnLoad
    'This is breakpointed

    End Sub
     
  4. Erel

    Erel Administrator Staff Member Licensed User

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice