I just checked my first post and I noticed that the task to "install the libraries" is not included. I though tasker includes every related task in the description. Here is such task:
datatablesInstall (110)A1: JavaScript [ Path:Tasker/javascript/lib/encoded_jquery.js.js Libraries: Auto Exit:On Timeout (Seconds):45 ] A2: Variable Set [ Name:%Jquery To:%source Do Maths:Off Append:Off ] A3: JavaScript [ Path:/sdcard/Tasker/javascript/lib/encoded_jquery.dataTables.min.js.js Libraries: Auto Exit:On Timeout (Seconds):45 ] A4: Variable Set [ Name:%Datatables To:%source Do Maths:Off Append:Off ] A5: JavaScript [ Path:Tasker/javascript/lib/encoded_jquery.dataTables.min.css.js Libraries: Auto Exit:On Timeout (Seconds):45 ] A6: Variable Set [ Name:%Styles To:%source Do Maths:Off Append:Off ] A7: Flash [ Text:Installed Long:Off ]
As you can see the key part are a couple of javascript files. Those javascript files "decodes" the file in binary format and then set a local variable with the content. Then that variable text is saved to a global variable. That is how I load the libraries on the memory. Then I just use eval on the web view to make that libraries available.
The task that creates the "encoded files" is very simple:
EncodeFile-text (107)
A1: [X] Variable Set [ Name:%fullpath To:/sdcard/Tasker/javascript/lib/datatables/media/css/jquery.dataTables.min.css Do Maths:Off Append:Off ]
A2: [X] Variable Set [ Name:%fullpath To:/sdcard/Tasker/javascript/lib/datatables/media/js/jquery.js Do Maths:Off Append:Off ]
A3: Variable Set [ Name:%fullpath To:/sdcard/Tasker/javascript/lib/datatables/media/js/jquery.dataTables.min.js Do Maths:Off Append:Off ]
A4: JavaScriptlet [ Code:var filename = fullpath.replace(/^.*[\\\/]/, ''); Libraries: Auto Exit:On Timeout (Seconds):45 ]
A5: JavaScriptlet [ Code:var path = fullpath.replace(/[^\/]*$/, ''); Libraries: Auto Exit:On Timeout (Seconds):45 ]
A6: Read File [ File:%path%filename To Var:%source ]
A7: Variable Convert [ Name:%source Function:URL Encode Store Result In:%enc_source ]
A8: JavaScriptlet [ Code:var encoded="var filename='"+filename+"'; var source= convert('"+enc_source+"','urlDecode');"; Libraries: Auto Exit:On Timeout (Seconds):45 ]
A9: Write File [ File:Tasker/javascript/lib/encoded_%filename.js Text:%encoded Append:Off Add Newline:On ]
I tried a different approach writing the file contents to a real file in the file system and it works perfectly. But for me that is more complicated since I have to know to which folder should I "decompress" the files and that is something I'm not sure about. Looks like you have to use the same folder as your app name, but I'm not sure about this.