DroidScript provides some methods and flags in the sourcecode which are not available in regular JavaScript code but are interpreted internally by DroidScript.
You don't necessarily need to use these features but they are still pretty useful in some cases.
The cfg object can be used to apply app options to your app before it is launched.
They should be placed at the very top of your main source script.
Defines the initial screen orientation your app will launch in
The Game configuration will let your app immediately run in GameView mode. This way you can write your game code directly in the main script without bothering about creating the GameView container.
This will let your app run transparently on the HomeScreen and it will stay on top of everything even if the user launches an other app.
These methods can force DroidScript to add or remove specific permissions from your app.
See also: GetPermission, CheckPermission
DroidScript checks if a callback function already exists and uses it instead of creating a new instance.
This can cause issues when referring to other local variables in private scopes.
Therefore you can wrap your callback functions in an I() clause to force DroidScript to create a new callback instance for that scope.
Alternatively you can make use of the controls data property and the this keyword in callbacks.
This way you can assign variables to the object they belong to and you still make use of the callback optimization by DroidScript: