Android Question Problems with AdMob Firebase

Discussion in 'Android Questions' started by Alberto Michelis, Jul 14, 2019.

  1. Alberto Michelis

    Alberto Michelis Active Member Licensed User

    Hi, my app is now copiled ok but I dont see the adds.
    If I add this code to the main activity I see the ad but when I add it to the second activity I dont see any add, this is the 2nd activity code:

    Code:
    Sub Activity_Create(FirstTime As Boolean)

        
        
    Activity.LoadLayout("Dashboard2")                                ' Loads "Page1" layout file
        Activity.Title = "PortIt"
        
        Panel1.Left=
    Activity.Width/2-Panel1.Width/2
        Panel1.Top=
    Activity.Height/2-Panel1.Height/2
        Panel1.Elevation = 
    2dip
        
        PortitCode.ResetUserFontScale(
    Activity)
        
        
    '--- AdMob Firebase
        BannerAd.Initialize2("BannerAd""ca-app-pub-3940256099942544/6300978111", BannerAd.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(BannerAd, 0dip100%y - height, 100%x, height)
        BannerAd.LoadAd
        IAd.Initialize(
    "iad""ca-app-pub-3940256099942544/1033173712")
        IAd.LoadAd
        
    '--- Fin AdMob Firebase
        
        lMalaInternet.Typeface = 
    Typeface.MONOSPACE
        
        lVersion.Text = 
    "Versión "&Main.VersionNombre
        
        
    If FirstTime = True Then
            SQL1.Initialize(
    File.DirInternal, "portit.db"False)
        
    End If   
        
        AppDir = 
    File.DirInternal
        DBDir = AppDir
        DBName = 
    "portit.db"
        BkpDir = 
    File.DirDefaultExternal
        MaxBackups = 
    5
        KVStore.Initialize(AppDir, 
    "KVStore")
        DB.Initialize(AppDir, DBName, 
    False)
    End Sub
    Thanks
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Are you handling the various events? Where are the logs?
     
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