#Region Project Attributes
#ApplicationLabel: Ad Mob pub
#VersionCode: 2
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
Private BannerAd As AdView
Private IAd,IAd2,IAd3,Iad4,Iad5 As InterstitialAd
Private Button1 As Button
Private Label1 As Label
Private Label2 As Label
Private Label3 As Label
Private Label4 As Label
Private Label5 As Label
Private Label6 As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("1")
Dim a As FirebaseAnalytics
a.Initialize
Log(a.IsGooglePlayServicesAvailable)
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, 0dip, 100%y - height, 100%x, height)
BannerAd.LoadAd
'test ad id ca-app-pub-3940256099942544/1033173712
IAd.Initialize("IAD", "ca-app-pub-8935643716482518/9334814214")
IAd.LoadAd
IAd2.Initialize("IAD", "ca-app-pub-8935643716482518/7354113164")
IAd2.LoadAd
IAd3.Initialize("IAD", "ca-app-pub-8935643716482518/4500719117")
IAd3.LoadAd
Iad4.Initialize("IAD", "ca-app-pub-8935643716482518/6000243862")
Iad4.LoadAd
Iad5.Initialize("IAD", "ca-app-pub-8935643716482518/4536378137")
Iad5.LoadAd
End Sub
Sub Activity_Click
End Sub
Sub IAD_AdClosed
' IAd.LoadAd 'prepare a new ad
End Sub
Sub IAD_AdFailedToLoad (ErrorMessage As String)
Log("Failed to load ad: " & ErrorMessage)
End Sub
Sub IAD_AdLoaded
Log("Ad loaded")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Button1_Click
Dim a = False
Dim b As Int = 0
Do While a=False
a = BoucleAd(IAd)
Log("1")
Label6.Text=""
Label2.Text="1"
Sleep(200)
If Not (a) Then
a = BoucleAd(IAd2)
Log(" 2")
Label2.Text=""
Label3.Text="2"
Sleep(200)
If Not (a) Then
a = BoucleAd(IAd3)
Log(" 3")
Label3.Text=""
Label4.Text="3"
Sleep(200)
If Not (a) Then
a = BoucleAd(Iad4)
Log(" 4")
Label4.Text=""
Label5.Text="4"
Sleep(200)
If Not (a) Then
a = BoucleAd(Iad5)
Log(" 5")
Label5.Text=""
Label6.Text="5"
Sleep(200)
End If
End If
End If
End If
b = b+1
Label1.Text= "Tentative n° " & b
Loop
End Sub
Sub BoucleAd(add As InterstitialAd) As Boolean
Dim a As Boolean = False
If add.Ready Then
add.Show
a= True
Return a
Else
add.LoadAd
Return a
End If
End Sub