android:configChanges="keyboard|keyboardHidden|orientation"/>)
Testing the Tapit Library:
please follow the example below.
'Activity module
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
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim tapit As TapitAd ‘declare variable as TapitAd
Dim button1, button2, button3, button4 As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("main")
button1.Initialize("button1")
button2.Initialize("button2")
button3.Initialize("button3")
button4.Initialize("button4")
tapit.Initialize("tapit", "Zone Id") ‘initialize the library and enter your Zone Id
Activity.AddView(tapit, 0, 0, 100%x, 90) ‘for banners, you can addview to panels, activity etc..
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub tapit_begin
Log("starting download.....") ‘For troubleshooting purposes
End Sub
Sub tapit_receivead
Log("succesfully showed ad")
End Sub
Sub tapit_error(reason As String)
Log(reason)
End Sub
Sub button1_Click
tapit.Interstitial(5, 20, 5, True) ‘Display Interstitial Ads, display close button 5 seconds after ad loads, autoclose in 20 seconds, update ads every 5 seconds, and set soundeffects to true. Note you can pass 0 to disable the autoclosing feature.
End Sub
Sub button2_Click
tapit.Full_Screen(10, False) ‘Display Full Screen Ads, Autoclose in 10 seconds and set show status bar to false.
End Sub
Sub button3_Click
tapit.Offer_Wall(False) ‘Display Offer Wall Ads, set show status bar to false.
End Sub
Sub button4_Click
tapit.Video_Ad(False, 20) ‘Display Video ads, set showstatus bar to False, and autoclose in 20 seconds.
End Sub
Troubleshooting:
Please refer to unfiltered logs to determine what may cause failure to load ads.
Make sure that all three required files are placed inside the Additional Libraries folder in the Basic4Android folder. TapitAds.jar, TapitAds.xml and TapitAdView.jar files.
Make sure the TapitAds library file is checked in the libs tab to the right of the screen in Basic4Android IDE.
Make sure that this attributes are added in the XML file.
AddApplicationText()
and
AddApplicationText(
android:configChanges="keyboard|keyboardHidden|orientation"/>)
For more information please refer to the Basic4Android forums, or the Tapit support forum.