#Region Project Attributes
#ApplicationLabel: Admob Interstitial Example
#VersionCode: 2
#VersionName: 2.0
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#AdditionalRes: C:\Android\extras\google\google_play_services\libproject\google-play-services_lib\res, com.google.android.gms
#End Region
Sub Process_Globals
End Sub
Sub Globals
Dim mwAdInterstitial As mwAdmobInterstitial
Dim Button1 As Button
Dim Label2 As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
mwAdInterstitial.Initialize("mwadi","ca-app-pub-........")
mwAdInterstitial.LoadAd
Activity.LoadLayout("1")
Label2.Text="Attempting to load ad... Please wait."
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub mwadi_AdClosed
Label2.Text="Ad dismissed by user."
Button1.Text="Load Ad"
End Sub
Sub mwadi_AdOpened
Log("ad opened")
End Sub
Sub mwadi_AdLoaded
Log("ad loaded")
Button1.Text="Show Ad"
Label2.Text="Ad loaded - Click Show Ad to Display"
End Sub
Sub mwadi_AdFailedToLoad (ErrorMessage As String)
Label2.Text="Ad failed to load with error code: " & ErrorMessage
Log("failed to load ad: " & ErrorMessage)
End Sub
Sub Button1_Click
If mwAdInterstitial.Status=mwAdInterstitial.Status_AdReadyToShow Then mwAdInterstitial.Show
If mwAdInterstitial.Status=mwAdInterstitial.Status_Dismissed Then
Label2.Text="Attempting to load ad... Please wait."
mwAdInterstitial.LoadAd
End If
End Sub