B4A Library Leadbolt Ads

Hi all,

(Long post warning!)

I am going to release a new library for leadbolt.

Please use following link to register (it will help me get some referral bonusses, and it will cost you absolutely nothing):

LeadBolt Mobile Ad network- Advertise and Monetize traffic on Android and iPhones

If you thought admob was bad, and airpush was a fresh breath of air, wait till you try leadbolt!

Lets just say what I can get from leadbolt is at WORST twice what I get from admob, and at BEST so far is 6 times what I get from admob. <-- on a daily basis! (was very very close to hitting $100 in one of my days on leadbolt alone)

I am doing some fine tuning on the library and should release it within the next 24 hours.

So please show some support and love for humanity, and sign up with the link above... hehe.. you will really like the revenue generated.

LeadBolt Mobile Ad network- Advertise and Monetize traffic on Android and iPhones

To test the ads out, download one of my games, BallTapp:

https://market.android.com/details?id=com.madelephantstudios.BallTapp&feature=search_result

It has admob, airpush and leadbolt in it.

On their site, they have a library for B4A built by them, that library adds the web type ads, something like what Millenial Media has. I have tried those and the returns are no fun at all.

Their push notifications are excellent, plus they arent as hated as airpush for some reason... overpublicity by airpush perhaps? LOL!

Do register your accounts with leadbolt and set up your ads for Notification (SDK) type.

Another good point about them is you will be assigned an accounts manager, who reply your mails and is contactable via IM. (unlike the unknown that is admob/google)

Questions or feedback welcome.

PS - Feedback is really appreciated as the other ad libraries I've released have had no responses if they work fine or not for others. :(

:sign0089:
 

nad

Active Member
Licensed User
Longtime User
Just in case someone finds the same problem. it took me some time to discover it

WebViewAd.LoadHtml("<html><head></head><body topmargin=0 leftmargin=0><script type='text/javascript' src='http://ad.leadbolt.net/show_app_ad.js?section_id=xxxxxxxxx'></script></body></html>")

you have to add the topmargin=0 and the leftmargin=0 or the ad will be slightly to the right and down.
 

nad

Active Member
Licensed User
Longtime User
Hello,

During configuration for LeadBolt, the manifest gets the following

<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"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>

Are these really necesary?

Thanks and regards,
 
Last edited:

ssg

Well-Known Member
Licensed User
Longtime User
Hi nad,

Thanks for the tip on webview. You might also need to override the click event/urloverride thing and open in the right browser:

B4X:
Sub wv_OverrideUrl (Url As String) As Boolean 'wv is your webview
   Dim i As Intent
   i.Initialize(i.ACTION_VIEW, url)
   StartActivity(i)
   Return True
End Sub

As for the permission, not all is needed. I have not used the location permissions at all in all my apps.

Network state and phone state are needed.

Wake lock I am not sure, but wakes your phone up when a new notification ad is received. I think it is not necessary if you are not using notification ad.

Receive boot completed is needed if you want the ads to auto show when devices restarts. Also not needed if you do not need notification ads to show when device boots up.

You can get rid of all the other location permissions, it is optional.

Do share how things go with leadbolt...

Good luck!
 

mkvidyashankar

Active Member
Licensed User
Longtime User
leadbolt notification AD

I have followed each step for creating notification Ad but failed to receive notification

here is manifest file

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.usnews"
android:versionCode="21"
android:versionName="6.2"
android:installLocation="internalOnly">
<uses-sdk android:minSdkVersion="4" />
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="false"/>
<application android:icon="@drawable/icon" android:label="USA News ">

<activity android:windowSoftInputMode="stateHidden" android:launchMode="singleTop" android:name=".main"
android:label="USA News in App" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation"/>

<receiver android:name="com.Leadbolt.AdNotification" />

</application>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<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" />
<uses-permission android:name="android.permission.WAKE_LOCK" />

</manifest>


and code is

adLeadbolt.loadLeadboltAds("xxxxxxxx", adLeadbolt.ADS_NOTIFICATION)

but i am not receiving the ads
any thing wrong here

please help:sign0085:
 

ssg

Well-Known Member
Licensed User
Longtime User
Hi Vidyashankar,

Just to check a few things first.

1 - Is the ad (for xxxxxxxx) set up as "on demand" notification in leadbolt's dashboard?
2 - Can you try adding adLeadbolt.setasync = true after the initialise line?
3 - They updated the android sdk, try re-downloading that and give it a try.

Let me know if it works or not... I'll try to help.

Good luck!
 

mkvidyashankar

Active Member
Licensed User
Longtime User
Hi Thank You very much ssg for help

I tried these steps

I changed Notification type as "on demand"

code is

adleadbolt.Initialize
adleadbolt.AsynchTask=True
adLeadbolt.loadLeadboltAds("913437026", adLeadbolt.ADS_NOTIFICATION)

then i used new SDK

but not getting the notifications :(
 

mkvidyashankar

Active Member
Licensed User
Longtime User
project zip file is 633 km not allowed here to upload

sending herewith code and manifest files
 
Last edited:

ssg

Well-Known Member
Licensed User
Longtime User
Hi Vidyashankar,

I think you should not use the same variable twice in following lines:

adLeadbolt.loadLeadboltAds("677831699", adLeadbolt.ADS_APP)
adLeadbolt.loadLeadboltAds("913437026", adLeadbolt.ADS_NOTIFICATION)

Try removing the first one and see.

Let me know if that works.
 

mkvidyashankar

Active Member
Licensed User
Longtime User
I tried this , now getting ads thank you very much ssg

Dim adleadbolt,adleadbolt1 As LeadboltWrapper

adleadbolt.Initialize
adleadbolt.AsynchTask=True
adLeadbolt.loadLeadboltAds("677831699", adLeadbolt.ADS_APP)
adleadbolt1.Initialize
adleadbolt1.AsynchTask=True
adLeadbolt1.loadLeadboltAds("913437026", adLeadbolt1.ADS_NOTIFICATION)
 
Last edited:

walterf25

Expert
Licensed User
Longtime User
Hello all, i apologize beforehand if this is a stupid question, i just signed up with Leadbolt and added my application and the whole 9 yards, i'm still trying to understand how to display their ads in my application, i copy the following code but where do i put this code within basic4android
<script type="text/javascript" src="http://ad.leadboltads.net/show_app_ad.js?section_id=xxxxxxxxx"></script>
can anyone help me out please?

Thanks,
Walter:sign0104:
 

mkvidyashankar

Active Member
Licensed User
Longtime User
What you are trying is html ad which can be displayed in web view

apart from this you can try this code

Dim adleadbolt,adleadbolt1 As LeadboltWrapper

adleadbolt.Initialize
adleadbolt.AsynchTask=True
adLeadbolt.loadLeadboltAds("your ad id", adLeadbolt.ADS_APP)
adleadbolt1.Initialize
adleadbolt1.AsynchTask=True
adLeadbolt1.loadLeadboltAds("your ad id", adLeadbolt1.ADS_NOTIFICATION)

to get your ad id, you have configure ads in leadbolt dashboard
 

ssg

Well-Known Member
Licensed User
Longtime User
What Vidyashankar said is right, you are setting up an ad unit as a html ad.

You will need to load the html snippet into a webview in your application.

Do consider the other ad types too as Vidyashankar has suggested.

Good luck and let us know if you need any further assistance!
 

pluton

Active Member
Licensed User
Longtime User
Hi everyone

I just changed some details in my tutorial here:
http://www.b4x.com/forum/69502-post26.html

Because in new version Leadbolt changed name from:
[OLD] - Dim adLeadbolt As AdMobWrapper
to
[NEW] - Dim adLeadbolt As LeadboltWrapper

and added two attachment:
lb_android_sdk_basic4android_v1.02.zip
  • - LeadboltWrapper.jar
  • - LeadboltController.xml
  • - LeadboltWrapper.xml
lb_android_sdk_v2.06.zip
  • - LeadboltController.jar

Have a nice day :)
 

walterf25

Expert
Licensed User
Longtime User
Hey guys, i apologize but i followed the code below, created an android sdk ad in leadbolt and it is approved but when i run the code on my emulator i don't see anything, what am I missing, help please!

Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.

Dim adLeadbolt As LeadboltWrapper
End Sub

Sub Activity_Create(FirstTime As Boolean)
activity.LoadLayout("layout1")

adLeadbolt.Initialize
adLeadbolt.AsynchTask = True

'set adLeadbolt.ADS_APP for app sdk ads and adLeadbolt.ADS_NOTIFICATION for notification ads
adLeadbolt.loadLeadboltAds("xxxxxxxxx", adLeadbolt.ADS_APP)
End Sub

:BangHead:
 

MiniDemonic

Member
Licensed User
Longtime User
@walterf25
You need to replace the x's with the ad id which you can find by going to the Apps page in Leadbolt and pressing Get Code on the ad you want to use.
 

LeadBoltBrian

Member
Licensed User
Longtime User
Hi B4A Family!

Brian from LeadBolt here - on behalf of our network, I'd just like to give a huge kudos to all of you for helping each other out with integration and making the LeadBolt/B4A library a great asset.

Seeing the level of support here is very inspiring and a true display of effective product development. Your input has been incredibly helpful and is much appreciated by our team.

Also, never hesitate to send a line to your Account Manager or our internal developers via apps [at] leadbolt [dot] com for anything needed outside the forum. We're always here to help.

Otherwise, keep up the great work in creating revenue streams with your apps. We're ecstatic to have you on board with us!

All the best,

The LeadBolt Crew
 
Top