Sub Globals
Dim pnlAD As Panel
Dim AdBar As AdView
Dim AD_SIZE As Object
Dim adWidth As Int
Dim adHeight As Int
End Sub
Sub AdBarInit
' set the AD Bar, choose the right size
If pnlAD.Width < 468dip Then
' normal
AD_SIZE = AdBar.SIZE_BANNER
adWidth = 320dip
adHeight = 50dip
Else If pnlAD.Width < 728dip Then
' large
AD_SIZE = AdBar.SIZE_IAB_BANNER
adWidth = 468dip
adHeight = 60dip
Else
' tablet
AD_SIZE = AdBar.SIZE_IAB_LEADERBOARD
adWidth = 728dip
adHeight = 90dip
End If
' add the AD bar on the panel
AdBar.Initialize2("Ad", "xxxxxxxxxxxxxxxx", AD_SIZE)
pnlAD.AddView(AdBar, 50%x-(adWidth/2), 0, adWidth, adHeight)
'AdBar.LoadAd
Log("AD initialized")
End Sub