Sub Process_Globals
Public App As Application
Public NavControl As NavigationController
Private Page1 As Page
Private iad As AdBannerView
End Sub
Private Sub Application_Start (Nav As NavigationController)
NavControl = Nav
Page1.Initialize("Page1")
Page1.Title = "Page 1"
Page1.RootPanel.Color = Colors.White
NavControl.ShowPage(Page1)
iad.Initialize("iad", iad.SIZE_BANNER)
Page1.RootPanel.AddView(iad, 0, 100%y - 50dip, 100%x, 50dip)
End Sub
Private Sub Page1_Resize(Width As Int, Height As Int)
Dim adHeight As Int
If App.iPadDevice Then
adHeight = 66dip
Else
If Width > Height Then 'landscape
adHeight = 32dip
Else
adHeight = 50dip
End If
End If
iad.SetLayoutAnimated(0, 1, 0, 100%y - adHeight, 100%x, adHeight)
End Sub
Sub iAD_ActionBegin
Log("action begin")
End Sub
Sub iAD_ActionFinish
Log("action finish")
End Sub
Sub iAD_FailedToReceiveAd (ErrorCode As String)
Log("Error: " & ErrorCode)
End Sub
Sub iAD_ReceiveAd
Log("Received ad")
End Sub