DroidScript wiki

(was AndroidScript) unofficial documentation by the community

User Tools

Site Tools


built_in:load_script

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

built_in:load_script [2015/11/09 08:10]
118.148.131.66 created
built_in:load_script [2015/11/09 08:13] (current)
118.148.131.66
Line 6: Line 6:
  
 E.g. E.g.
- ​app.LoadScript("​js/​myScript.js"​);​+ ''​app.LoadScript("​js/​myScript.js"​);​''​
  
 You could have a required project app that does nothing but place your shared libraries on Users' devices in a common location, so your other apps could share them.  You could have a required project app that does nothing but place your shared libraries on Users' devices in a common location, so your other apps could share them. 
Line 16: Line 16:
 Something like - Something like -
  
-var libraryLocationPath ​ = "/​storage/​emulated/​0/​myAppProjectsLibrary/";​+''​var libraryLocationPath ​ = "/​storage/​emulated/​0/​myAppProjectsLibrary/";​
  
 if (app.FileExists(libraryLocationPath + "​manifestVersionInfoEtc.js"​)){ if (app.FileExists(libraryLocationPath + "​manifestVersionInfoEtc.js"​)){
Line 22: Line 22:
 }else{ }else{
 // take steps with User to download (fresh) libraries // take steps with User to download (fresh) libraries
-}+}''​
  
 Although you could easily achieve it, some Users might not like you directly downloading and installing files onto their device from web addresses unkown to them, and may prefer the PlayStore approach. Although you could easily achieve it, some Users might not like you directly downloading and installing files onto their device from web addresses unkown to them, and may prefer the PlayStore approach.
Line 36: Line 36:
 If you really really need something you don't want in, or can't embed in your main script, and it is small enough not to slow your app's initial loading down, and you are putting the script in a folder under your project, or local absolute path, then if it is crucial to you to have it before OnStart(), you might consider using:— If you really really need something you don't want in, or can't embed in your main script, and it is small enough not to slow your app's initial loading down, and you are putting the script in a folder under your project, or local absolute path, then if it is crucial to you to have it before OnStart(), you might consider using:—
  
-var myObject = app.ReadFile("​lib/​myObject.js"​);​+''​var myObject = app.ReadFile("​lib/​myObject.js"​);​
  
 // authenticate the file by a means known to you, if so, then ... // authenticate the file by a means known to you, if so, then ...
-myObject = eval(myObject);​+myObject = eval(myObject);​''​
  
 PAN PAN
- 
  
  
  
built_in/load_script.txt · Last modified: 2015/11/09 08:13 by 118.148.131.66