Android Question android 8.0 not showing banner ads

ronell

Well-Known Member
Licensed User
Longtime User
i've tested my app 3 device. 4.3, 6.0 and 8.0 os version .. in 8.0 the banner ads is not showing even after ReceivedAd event is raised
does android 8.0 have an issue in viewing banner ads?
 

asales

Expert
Licensed User
Longtime User
To me it works fine (banner, interstitial and native ads), but I do not upgraded to the last version of Firebase Admob library.
 
Upvote 0

ronell

Well-Known Member
Licensed User
Longtime User
i guess il need to take a look at my code specifically when i add the banner adview

btw i use the code in the tutorial.. or maybe something is wrong in the code?
B4X:
BannerAd.Initialize2("BannerAd", "ca-app-pub-1458452439035293/**********", BannerAd.SIZE_SMART_BANNER)
    Dim height As Int
    Log("Approximate Size: "&GetDeviceLayoutValues.ApproximateScreenSize) '<----- approximate screen size of android 8.0 is 5.5xxxxxx
    If GetDeviceLayoutValues.ApproximateScreenSize < 6 Then
        'phones
        If 100%x > 100%y Then 
            height = 32dip 
        Else 
            height = 50dip
            btnlogin.Top = 100%y - height - btnlogin.Height - 10dip
        End If
    Else
        'tablets
        height = 90dip
    End If
    Activity.AddView(BannerAd, 0dip, 100%y - height, 100%x, height)
    BannerAd.LoadAd
 
Upvote 0

ronell

Well-Known Member
Licensed User
Longtime User
It looks correct. As a test try it with the default size:
B4X:
    adview1.Initialize2("ad", "ca-app-pub-1xxx/xxx", adview1.SIZE_BANNER)
   Activity.AddView(adview1, 0, 0,  320dip, 50dip)

Check the unfiltered logs for messages.
thanks! il try it and update the thread if this solves the problem
 
Upvote 0

ronell

Well-Known Member
Licensed User
Longtime User
It looks correct. As a test try it with the default size:
B4X:
    adview1.Initialize2("ad", "ca-app-pub-1xxx/xxx", adview1.SIZE_BANNER)
   Activity.AddView(adview1, 0, 0,  320dip, 50dip)

Check the unfiltered logs for messages.
the ads is shown but it didnt fill the whole width.. is there a workaround to fill width even when using Adview1.SIZE_BANNER?
 
Upvote 0
Top