Leadbolt with Droidscript

297 views
Skip to first unread message

Vinetwigs.

unread,
Aug 5, 2016, 6:05:36 AM8/5/16
to DroidScript
I found on Youtube a video showing Leadbolt on DS app.
Is that really possible adding Leadbolt's ads on DS apps?

Video Link : https://www.youtube.com/watch?v=jYKDrQs-EFE

sankarshan dudhate

unread,
Aug 5, 2016, 6:48:02 AM8/5/16
to DroidScript
Yes, you can use leadbolt ads in your DS apps.

To be honest, leadbolt is really good but it won't fulfill all the needs. You can also use AppNext.

Now, this gets a bit complex. You can use a central ad serving platform to integrate more than one ad network. Example, if leadbolt has no ad available at a point, the SSP ( supply side platform ) will let you use some other ad network's ads. This also allows you to use the one which pays you the most.

You can also use video ads or native ads with such SSPs. Two such well-known SSPs are MoPub and Smaato. I am, at the moment, thinking of switching to Smaato as Smaato lets you integrate MoPub too :)

Regards,
Sankarshan

Vinetwigs.

unread,
Aug 5, 2016, 8:45:31 AM8/5/16
to DroidScript
Thank you for the answer.
Can u explain me how to add Leadbolt or Appnext's ads in my app?
I tried to add Leadbolt's html ads in one app but when i click on the ads nothing happens and the console says there are always 0 click and 0 views.
Can u send me an app sample with ads?

(sorry for my bad English)

sankarshan dudhate

unread,
Aug 5, 2016, 9:54:51 AM8/5/16
to DroidScript
The ads you see are test ads I guess. You'll be served test ads until you send them a link where they can download the app from ( like Google Play Store or your website ) for approval. They just check whether or not the ads are placed properly. Once approved, user will be served live ads.

Vinetwigs.

unread,
Aug 5, 2016, 10:06:20 AM8/5/16
to DroidScript
Thank you.
I'm having a problem with ads.
When i add ads on the margins of the screen it doesn't displays nothing, instead if the ad doesn't touch the edges of the screen it work.
How can i solve ?

sankarshan dudhate

unread,
Aug 5, 2016, 10:19:58 AM8/5/16
to DroidScript
Hmmm... Don't know what's the cause. Can you show us the code you are using ? Also, what format of ad are you using ( width and height ) ?

For reference code, have a look at the following thread
https://groups.google.com/forum/m/?pli=1#!searchin/androidscript/leadbolt$20ads/androidscript/BbXJUK09vUE

Vinetwigs.

unread,
Aug 5, 2016, 1:28:40 PM8/5/16
to DroidScript
var lastUrl,web;
var script='<script type="text/javascript" src="http://ad.leadbolt.net/show_app_ad.js?section_id=264118794"></script>'
var script1='<script type="text/javascript" src="http://ad.leadbolt.net/show_app_ad.js?section_id=295397312"></script>'
function OnStart()
{
 lay = app.CreateLayout("Absolute","VCenter","FillXY");  
 
 banner=app.CreateLayout("Absolute","Horizontal","FillXY");
 banner.SetSize(1,0.08);
 lay.AddChild(banner);
 
 
 web=app.CreateWebView(1,0.12);
 web.SetPosition(0,0.1);
 web.SetOnProgress(webOnProgress);
 web.LoadHtml(script);
 lay.AddChild(web);
 
 app.AddLayout(lay);
    
}

function webOnProgress()
{
 var url=this.GetUrl();
 if(url==lastUrl) return
 lastUrl=url;
 if(url.slice(0.9)==="market://")
 {
  this.LoadHtml(script);
  app.OpenUrl(url);
 }
    
}

Steve Garman

unread,
Aug 5, 2016, 1:37:58 PM8/5/16
to DroidScript
I haven't tested your code but this hit me in the eye.

if(url.slice(0.9)==="market://")

0.9 should be 0,9

It means start at 0 and select 9 characters

Vinetwigs.

unread,
Aug 5, 2016, 1:44:18 PM8/5/16
to DroidScript
Thank you.
Now the code works but i found another "bug".
I add a second webview whichshows another script (var script1='<script type="text/javascript" src="http://ad.leadbolt.net/show_app_ad.js?section_id=295397312"></script>') but on the app it is white and doesn't show nothing.

Netpower8

unread,
Aug 6, 2016, 3:16:25 AM8/6/16
to DroidScript
Weird. Bothe script and script1 works when i tried it. I add a semi colon on thr end since both vars didnt put a semicolon at the end

Vinetwigs.

unread,
Aug 6, 2016, 5:09:01 AM8/6/16
to DroidScript
Can you show me the code you used please?

Netpower8

unread,
Aug 6, 2016, 6:31:47 AM8/6/16
to DroidScript
Wait let me update some code

Netpower8

unread,
Aug 6, 2016, 6:47:56 AM8/6/16
to DroidScript
After updating the code to use the orginal code. It works also. No problem encountered. Both script works fine i did get a white space but that was when internet connection was not so good.

So there is jothing wrong with the code you posted. It works ok.

Just try it again. Will post the images in a while

Netpower8

unread,
Aug 6, 2016, 7:22:48 AM8/6/16
to DroidScript
the 2nd script appears to take a long time to load. are you sure the 2nd script is a banner ad? i change the size and it appears to be a full page ad....

Netpower8

unread,
Aug 6, 2016, 7:43:24 AM8/6/16
to DroidScript
here's the screen capture image. the script and script1. the script1 took a long time to load. so i adjusted the display size ... to whole page... and it appears to be a whole page ad. maybe it took a long time becase it was resizing the image to fit into the banner type ad
script.png
script1.png
whole page.png

Vinetwigs.

unread,
Aug 6, 2016, 8:24:57 AM8/6/16
to DroidScript
Thank you so much Netpower8!

Mighty Apps Studio

unread,
May 10, 2017, 1:13:36 PM5/10/17
to DroidScript
i Have One question, What si this id section and do i need my own

Netpower8

unread,
May 10, 2017, 3:13:51 PM5/10/17
to DroidScript
Yes. You should. You will need to register with leadbolt to get your own id. And have a test id to test your app on display of ads.

Pete Bradley

unread,
Jan 18, 2018, 12:54:56 PM1/18/18
to DroidScript
Does anyone know how to get the clicks to open in full chrome?,   When I click on the test ad's they just open in the tiny webview

Steve Garman

unread,
Jan 18, 2018, 4:53:52 PM1/18/18
to DroidScript

Dave Smart

unread,
Jan 19, 2018, 7:18:52 AM1/19/18
to DroidScript
DS 158a1
- Added 'UseBrowser' option to Webview to cause links to launch in the default browser.


Pete Bradley

unread,
Jan 19, 2018, 10:09:59 AM1/19/18
to DroidScript
Thanks!!

JAUREGUI

unread,
Jan 30, 2018, 3:30:16 PM1/30/18
to DroidScript
I created a webview for leadbold ads using the option 'UseBrowser' as Dave suggested, it works fine when testing, but once I created the APK and installed it doesn't work (opens in the same webview) Has this happened to someone else?

       wp = app.CreateWebView(1, .1, "UseBrowser");
 

Steve Garman

unread,
Jan 30, 2018, 3:35:47 PM1/30/18
to DroidScript
Have you reinstalled the apk-builder plugin since installing DS 1.61?

If not, it won't know how to apply the UseBrowser option.

JAUREGUI

unread,
Jan 30, 2018, 7:18:57 PM1/30/18
to DroidScript
Hi Steve, I opened the plugin and It shows 1.59, but I have been trying to reinstalling it and still spear the same version, the same is shown in the playstore, 
How can I updated?

Steve Garman

unread,
Jan 31, 2018, 4:37:48 AM1/31/18
to DroidScript
That does seem to be an oversight.

In the meantime you can go to http://androidscript.org/apk/DroidScript_161/ and download the file apkbuilder.zip then drop it into a folder /sdcard/DroidScript/Plugins

Restart DroidScript and it should install itself

JAUREGUI

unread,
Jan 31, 2018, 11:52:24 AM1/31/18
to DroidScript
Thanks Steve for your help I appreciate it...

Now works just great...

Jared

unread,
Jul 28, 2018, 8:06:06 PM7/28/18
to DroidScript
I got leadbolt working nicely 

Used a webview horizontal layout, and a parent frame layout. Made it touchthrough option, and then added the layout at the very end of OnStart. Loads the ad from an html file in assets.



Jared

unread,
Jul 28, 2018, 8:08:06 PM7/28/18
to DroidScript
It would be easy to add an in app purchase to remove ad. Would be as simple as just setting the frame to Gone()

Questao De 5 Minutos

unread,
Aug 20, 2018, 6:36:58 PM8/20/18
to DroidScript
because it's, I'm studying in the documentation how to do this, but I'm breaking my head, disabling the banner with a function inside the application is easy, but adding the pushed in app is difficult

nikhil babychan

unread,
Aug 22, 2018, 1:54:51 AM8/22/18
to DroidScript
I have successfully added LeadBolt ads in Creative IDE app published in Google Play....Here is the code

//=========================
var ads = "<html><body style='width: 100%; overflow: hidden; margin: 0 0 0 0;'><script type='text/javascript' src='http://ad.leadbolt.net/show_app_ad.js?section_id=246263530'></script>";
ads += "</body></html>";


//Create a web control.
webhjo_fo = app.CreateWebView( 1, 0.1, "IgnoreErrors,Noscrollbars");
webhjo_fo.SetPosition( 0, 0.91);
webhjo_fo.SetBackColor( "#ffffff" );
webhjo_fo.SetOnProgress( function ()
{
//http:ad.leadbolt.net/clk?ad_id=9705790&section_id=246263530&cat_id=40&req_id=KLGCNo6-AtE3mHsILLtZMQfvuksfyMhfX-L10r8M_97jgITs-6vP68i1d0qokpfBm9RC68QLVxNSLEHKicpXpQ~~&dev=BysFE4EGEMHW2Szv4QKltRR2ifxe1dRwWGLQVGnB_3y_EWZ4Z34NOTWDT8lNbLsB_XwRMfa-Kt1AyWSkF3zRKNKM7MRnCiPps-sdad2cggOB9zJAkGXlHVbpAlv_Wy8QWh9gGcWYSt4AEGA8KrMPOEbmMw7d_Fb7yqWUqouFITU~&exp=YCU-D9uRP9vDyN_Af9P5ts3fiG40T__W-IrBAwm2tSBdLDkK40GxGzs81wbsXG60
//about:blank
if( webhjo_fo.GetUrl()=="about:blank" || webhjo_fo.GetUrl().indexOf( "ad.leadbolt.net" ) > -1){

}
else {
azzzy = webhjo_fo.GetUrl();
var adsxx = "<html><body style='width: 100%; overflow: hidden; margin: 0 0 0 0;'><script type='text/javascript' src='http://ad.leadbolt.net/show_app_ad.js?section_id=246263530'></script>";
adsxx += "</body></html>";
webhjo_fo.LoadHtml( adsxx );
app.OpenUrl( azzzy );
}
}
);
webhjo_fo.LoadHtml( ads );
layScroll.AddChild( webhjo_fo );
//=========================


I hope this helps....
Regards,
Nikhil

nikhil babychan

unread,
Aug 22, 2018, 2:06:46 AM8/22/18
to DroidScript
And Dave.... "Usebrowser" method doesn't work with LeadBolt.....The ads clicks are not counting.....

M r

unread,
Nov 28, 2018, 6:19:55 PM11/28/18
to DroidScript
How do i make a close button for ads?
Reply all
Reply to author
Forward
0 new messages