LeadBolt Instructions New Library
Ok
This is for new users and anyone which don't know how work with LeadBolt.
So here it is
LeadBolt Basic4Android library - version 1.4
Requirements
------------
1. You must have a basic4android account that allows inclusion of 3rd party libraries (
Basic4android (Basic for Android) - Rapid Application Development)
2. You must have a LeadBolt app publisher account (
http://www.leadbolt.com) <- my referal link for developers
3. You must have accessed your leadbolt account to register your android app and have created ads, retrieved the relevant section ids.
4. From the help/faq section of the leadbolt portal, you must have downloaded the latest (version 2.0 and above) LeadBolt android publisher SDK (LeadboltController.jar contained in SDK zip).
Integration
------------
The following needs to be completed in the basic4android IDE
1. Unzip the LB_basic4android_lib.zip file and copy all unzipped files (including the *.xml files) to the additional libraries path of the Basic4Android IDE.
2. Copy Leadbolt native library jar files to the same folder as above one.
3. In the Basic4Android IDE, add references to library
pubiapp.jar,
pubxappCom.jar,
LeadboltIWrapper.jar and
LeadboltXWrapper.jar in your project. (see image 01)
In this image stands also old LeadBolt library. That is marked with green color. You don't need it anymore so you can delete it from library.
4. Add the relevant code to display LeadBolt ads within your app. Following is the typical code for adding ads to your Basic4Android project:
'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 iLeadbolt As LeadboltIWrapper
Dim xLeadbolt As LeadboltXWrapper
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Main")
'for banner, unlocker and capture form ads
iLeadbolt.Initialize("LeadboltI")
iLeadbolt.setListener()
iLeadbolt.loadLeadboltAds("YOUR_SECTION_ID")
'for notification and icon ads
'set xLeadbolt.ADS_NOTIFICATION for notification ads, and
'xLeadbolt.ADS_ICON for icon ads.
xLeadbolt.Initialize("LeadboltX")
xLeadbolt.setListener()
xLeadbolt.loadLeadboltAds("YOUR_SECTION_ID", xLeadbolt.ADS_NOTIFICATION)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
'4. This SDK also supports event listener For Ads loading. To implement event callbacks, call adLeadbolt.setListener() before loading your ads AND implements following Sub:
'for banner, unlocker and capture form ads event
Sub LeadboltI_AdClicked
End Sub
Sub LeadboltI_AdClosed
End Sub
Sub LeadboltI_AdCompleted
End Sub
Sub LeadboltI_AdFailed
End Sub
Sub LeadboltI_AdLoaded
End Sub
Sub LeadboltI_AdProgress
End Sub
Sub LeadboltI_AdAlreadyCompleted
End Sub
Sub LeadboltI_AdHidden
End Sub
'for notification event
Sub LeadboltX_AdPause
End Sub
Sub LeadboltX_AdResume
End Sub
5. In "Activity Properties" of the Basic4Android IDE Project menu, untick "Full Screen" and "Include Title".
6. In the Basic4Android IDE, Tick "Do Not Overwrite Manifest File" in Project menu.
7. Open YourProject/Objects/AndroidManifest.xml file, add
<receiver android:name="com.Leadbolt.AdNotification" />
set
android:anyDensity="false"
and save
9. Add following code to this AndroidManifest.xml file:
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
//for notification ads.
<uses-permission android:name="android.permission.WAKE_LOCK" />
//for icon ads.
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
<uses-permission android:name="com.android.browser.permission.WRITE_HISTORY_BOOKMARKS"/>
//for capture form ads.
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
and
<receiver android:name="com.pad.android.xappad.AdNotification"/>
to your application tag.
10. Run your application in the Basic4Android emulator to check you see LeadBolt test ads.
Image1 (When user start app for first time it shows Toastmessage from Leadbolt)
Image2 (This is how app look with 4 ads showing it)
Image3 (This is how look notification from LeadBolt ads)
EDIT: Updated SDK to 3.06b version 13.09.2012
Added in attachments of this post:
lb_android_sdk_basic4android_v1.04.zip
- LeadboltIWrapper.jar
- LeadboltXWrapper.jar
- LeadboltIWrapper.xml
- LeadboltXWrapper.xml
- pubiapp.xml
- pubxappCom.xml
- readme.txt
lb_android_sdk_iapp_v3.06a.zip
lb_android_sdk_pubxappCom_v3.06a.zip
lb_android_sdk_xapp_v3.06a.zip