I don’t understand bindings :/ i’d like to display a String that changes to another String every 20 minutes sorta…

I don’t understand bindings :/ i’d like to display a String that changes to another String every 20 minutes sorta like a random greeting kinda thing, bindings seem to be the way to do it but how.

]]>

7 Commentsto I don’t understand bindings :/ i’d like to display a String that changes to another String every 20 minutes sorta…

  1. Anonymous says:

    < ![CDATA[

    Don’t feel bad, i never seen a theme in the play store that uses them. The only themes i saw are the ones from back in 2013-14

    ]]>

  2. Anonymous says:

    < ![CDATA[

    I wanna change that Android TV text to something else. The idea was to wack a load of clever lyrics into a file then display them randomly every 20 minutes or 2 hours how often would depend on how manys in the file.https://lh3.googleusercontent.com/N5jEjk80d9W7ZegZr09Lk5fnWfuD5KZoTznsCDnonMY4Nlk_2YSXtaMZWJ1czNLp4fLWlElieA

    ]]>

  3. Anonymous says:

    < ![CDATA[

    Jay M And all of them Taylor Swift yeah yeah we know lmao I’m joking I’m joking.

    ]]>

  4. Anonymous says:

    < ![CDATA[

    I miss programming..


    in the sample/snippet below, I creating a forecast weather folder



    I create a shortcut on a folder container, set it’s name, then


    I had the option to either create multiple variables for all the weather items (just one variable in the code)


    or I could have just one variable and parse the JSON once the variable gets updated (that was the option I choose)



    hope this helps




    var itm = fol_c.addShortcut(“location”, new Intent(), 0, 0);


    itm.setName(“weather_location”);



    //itm.setBinding(“s.label”,’$weather_loc’,true);



    itm.setBinding(“s.label”,’var wx_str = $weather;\n’ + ‘var wx = JSON.parse(wx_str);\n’ + ‘return wx.loc;’, true);

    ]]>

  5. Anonymous says:

    < ![CDATA[

    cheers mate 👍

    ]]>

  6. Anonymous says:

    < ![CDATA[

    just 2 extra cents in case that someone is looking for the same



    with bindings you only need to update the variable and whatever you had in the code will perform after the update



    and I believe that you need to have at least one variable using the following nomenclature (starting with the dollar sign)


    $variable

    ]]>

  7. Anonymous says:

    < ![CDATA[

    Set Dummy.


    This makes a variable “LastUpdate”.


    If starting this, or over 20 minutes, this will be executed immediately when LL active.



    bindClass(“android.os.Handler”);


    bindClass(“java.lang.Runnable”);


    var interval=20; //minutes


    var mintime=5; //minutes


    interval=interval*60;


    mintime=mintime*60;


    var ptime=0;


    var lasttime=new Date(LL.getVariables().getString(“LastUpdate”))/1000;


    var now=$ll_timestamp;


    if(lasttime%interval!=0){


    ptime=lasttime%interval;


    if(ptime>interval-(mintime)){


    ptime=ptime-interval;


    }


    interval=interval-ptime;


    }


    if(


    now>=(lasttime+interval)


    ){


    try{


    var mhandler=new Handler();


    mhandler.post(new Runnable({


    run:function(){


    setVariableString(“LastUpdate”,new Date().toString());


    //CODE YOU WANT RUNNING


    //getActiveScreen().runScript(“test1”,null);


    }}));


    return;


    }catch(e){return;}


    }

    ]]>

Leave a Reply

Your email address will not be published. Required fields are marked *