ADD ADS IN DROIDSCRIPT [sample]

412 views
Skip to first unread message

nikhil babychan

unread,
Jul 4, 2018, 1:12:13 AM7/4/18
to DroidScript
Hi,
Here is a sample of adding LeadBolt ads in DroidScript... This sample is working perfectly used in 2 apps published in Google play....

====Link to the sample=====
https://www.dropbox.com/s/zunyhu19sb5nrij/LeadBolts%20Ads.spk?dl=0


====For creating account in LeadBolt=====
Sign up in http://leadbolt.com and Create a app select Android as platform and add the app....Then create a section and select HTML Ads and get the id from creating banner ads....copy paste the id in spk

Regards,
Nikhil

Dmitriy Pavlov

unread,
Apr 25, 2019, 6:19:31 AM4/25/19
to DroidScript
IT'S BESTER,YOU HAVE A BANNER.SPK?

Dmitriy Pavlov

unread,
May 2, 2019, 12:29:55 PM5/2/19
to DroidScript
Написал для банера:



//Called when application is started.
function OnStart()
{
//Create a layout with objects vertically centered.
lay = app.CreateLayout( "Linear", "FillXY,VCenter" );
    lay.SetBackColor( '#ffffffff' );
    btnDo = app.CreateButton( "<i><b><u>ПОКАЗАТЬ  DIALOG</u></b></i>",-1,-1,"Custom,HTML" );
    btnDo.SetStyle( "#ffff00", "#ffff00", 40, "red", 3, 0 );
    btnDo.SetTextColor( "red" );
    btnDo.SetOnTouch( btnDo_OnTouch );
    btnDo.SetTextSize( 14 );
    lay.AddChild( btnDo );
//Create a text label and add it to layout.



dlg = app.CreateDialog('');

layDlg = app.CreateLayout( "absolute", "vertical,center" );
    layDlg.SetSize( 1,1);
    layDlg.SetBackColor( '#ffffff' );
    

    
 

    
    
    
    
    
    
    
 
    
    

    dlg.AddLayout( layDlg );

 // dlg.Show();
app.AddLayout( lay );
}


function btnDo_OnTouch()
{ leadbolt_id = "929303074";//"861934303";//
  html_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=" + leadbolt_id + "'></script></body></html>";
ad_webview = app.CreateWebView( 1, 1, "IgnoreErrors,Noscrollbars");
  //ad_webview.SetPosition( 0, 0.91);
//ad_webview.SetBackColor( "#ffffff" );
ad_webview.SetOnProgress( function (){
  if( ad_webview.GetUrl()=="about:blank" ||  ad_webview.GetUrl().indexOf( "ad.leadbolt.net" ) > -1){  }  else {
  web_ad_current_url  = ad_webview.GetUrl();
ad_webview.LoadHtml( html_ads );
app.OpenUrl( web_ad_current_url ); } });
ad_webview.LoadHtml( html_ads );
layDlg.AddChild( ad_webview );

    
    dlg.Show();
setTimeout('btnf()',3000);
}

function btnf(){
  btn = app.CreateButton('[fa-times-circle]',0.2,-1,'FontAwesome');
// btn.SetBackColor('#88000000');
    btn.SetPosition(0.8,0);
    btn.SetTextSize(32);
    btn.SetOnTouch(function(){dlg.Dismiss()});
    layDlg.AddChild(btn);  
    }
function btnBack_OnTouch()
{
dlg.Dismiss();
}

CreativeMind

unread,
May 10, 2019, 9:39:23 PM5/10/19
to DroidScript
Nikhil,

I don't have Dropbox. Any chance you could post the ad sample in a comment or as an spk?

nikhil babychan

unread,
May 11, 2019, 12:47:31 PM5/11/19
to DroidScript
You dont need a DropBox account to download it,
Any how I have attached the spk.

LeadBolts Ads.spk

nikhil babychan

unread,
May 11, 2019, 1:17:43 PM5/11/19
to DroidScript
PLEASE NOTE THIS
I used LeadBolt in 2 apps (The app is over 40,000k downloads), I didn't ever get any reasonable ad revenue from LeadBolt. LeadBolt has the worst eCPM rates (I think so). And LeadBolt some times moves the ad app to test mode automatically sometimes. If you are using LeadBolt, Do please check the admin panel more often.
I recommend to build a website and use AdSence in it and load the website in the DroidScript app using the WebView and hide the other website contents using webView.Execute(); (This is a experiment method, I am testing this method in my current apps and I think its not good to use 'UseBrowser' option in webview, it did'nt count as a click in AdSence network)
 
I some where in this group heard that someone is working on the Adword plugin, I am really glad to hear the status of that project.
Reply all
Reply to author
Forward
0 new messages