java.lang.Object | |
↳ | net.pierrox.lightning_launcher.script.api.LL |
This class is deprecated.
check alternatives on each function.
The main object to access Lightning Launcher features. The LL object gives access to desktops, items or give contextual data on the event.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
boolean | bindClass(String name) | ||||||||||
ImageAnimation |
createAnimation(int width, int height, int count, int duration, int loopCount)
This method is deprecated.
use
createAnimation(int, int, int, int, int) instead
LL.createAnimation(width, height, count, duration, loopCount) -> Image.createImage(width, height, count, duration, loopCount)
| ||||||||||
ImageBitmap |
createImage(int width, int height)
This method is deprecated.
use
createImage(int, int) instead
LL.createImage(width, height) -> Image.createImage(width, height)
| ||||||||||
Image |
createImage(String path)
This method is deprecated.
use
createImage(String) instead
LL.createImage(path) -> Image.createImage(path)
| ||||||||||
Image |
createImage(String pkg, String name)
This method is deprecated.
use
createImage(String, String) instead
LL.createImage(pkg, name) -> Image.createImage(pkg, name)
| ||||||||||
ImageScript |
createImage(Scriptable object, int width, int height)
This method is deprecated.
use
createImage(Scriptable, int, int) instead
LL.createImage(object, width, height) -> Image.createImage(object, width, height)
| ||||||||||
Script |
createScript(String name, String text, int flags)
This method is deprecated.
use
createScript(String, String, int) instead
LL.createScript(name, text, flags) -> createScript(name, text, flags)
| ||||||||||
ImageBitmap |
cropImage(ImageBitmap image, boolean full_size)
This method is deprecated.
use
cropImage(ImageBitmap, boolean) instead together with an ActivityScreen
LL.cropImage(image, full_size) -> 'cropImage' in getActiveScreen() ? getActiveScreen().cropImage(image, full_size) : null
| ||||||||||
void |
deleteScript(Script script)
This method is deprecated.
use
deleteScript(Script) instead
LL.deleteScript(script) -> deleteScript(script)
| ||||||||||
Array |
getAllDesktops()
This method is deprecated.
use
getAllDesktops() instead together with getConfiguration()
(Difference: returns a java array instead of Array , convert if necessary)
LL.getAllDesktops() ~> getConfiguration().getAllDesktops()
| ||||||||||
Array |
getAllScriptMatching(int flags)
This method is deprecated.
use
getAllScriptMatching(int)
(Difference: returns a java array instead of Array , convert if necessary)
LL.getAllScriptMatching(flags) ~> getAllScriptMatching(flags)
| ||||||||||
Container |
getContainerById(int id)
This method is deprecated.
use
getContainerById(int) instead with a Screen
LL.getContainerById(id) -> getEvent().getScreen().getContainerById(id)
| ||||||||||
Context |
getContext()
This method is deprecated.
use
getContext() instead with a Screen
LL.getContext() -> getActiveScreen().getContext()
| ||||||||||
Desktop |
getCurrentDesktop()
This method is deprecated.
use
getCurrentDesktop() instead together with getActiveScreen()
LL.getCurrentDesktop() -> getActiveScreen().getCurrentDesktop()
| ||||||||||
Script |
getCurrentScript()
This method is deprecated.
use
getCurrentScript() instead
LL.getCurrentScript() -> getCurrentScript()
| ||||||||||
Desktop |
getDesktopByName(String name)
This method is deprecated.
use
getDesktopByName(String) instead together with getHomeScreen()
LL.getDesktopByName(name) -> getHomeScreen().getDesktopByName(name)
| ||||||||||
Event | getEvent() | ||||||||||
Desktop |
getFloatingDesktop()
This method is deprecated.
use
getContainerById(int) instead together with getFloatingDesktopId()
LL.getFloatingDesktop(); -> getFloatingScreen().getContainerById(getConfiguration().getFloatingDesktopId())
| ||||||||||
Desktop |
getHomeDesktop()
This method is deprecated.
use
getContainerById(int) instead together with getHomeDesktopId()
LL.getHomeDesktop() -> getHomeScreen().getContainerById(getConfiguration().getHomeDesktopId())
(note: in some rare cases getHomeScreen() may return null. If necessary consider searching on getBackgroundScreen() as an alternative)
| ||||||||||
Item |
getItemById(int id)
This method is deprecated.
use
getItemById(int) instead together with a Screen
LL.getItemById(id) -> getEvent().getScreen().getItemById(id)
| ||||||||||
Desktop |
getLockscreenDesktop()
This method is deprecated.
use
getContainerById(int) instead together with getLockscreenDesktopId()
LL.getLockscreenDesktop() -> getLockScreen().getContainerById(getConfiguration().getLockscreenDesktopId())
(note: in most cases getLockScreen() may return null. If necessary consider searching on getHomeScreen() or getBackgroundScreen() as an alternative)
| ||||||||||
Array |
getOpenFolders()
This method is deprecated.
use
getOpenFolders() instead together with getActiveScreen()
(Difference: returns a java array instead of Array , convert if necessary)
LL.getOpenFolders() ~> getActiveScreen().getOpenFolders()
| ||||||||||
Script |
getScriptById(String id)
This method is deprecated.
use
getScriptById(String) instead
LL.getScriptById(id) -> getScriptById(id)
| ||||||||||
Script |
getScriptByName(String name)
This method is deprecated.
use
getScriptByName(String) instead
LL.getScriptByName(name) -> getScriptByName(name)
| ||||||||||
String |
getScriptTag()
This method is deprecated.
use
getTag() instead together with getCurrentScript()
LL.getScriptTag() -> getCurrentScript().getTag()
| ||||||||||
VariableSet | getVariables() | ||||||||||
void |
goToDesktop(int id)
This method is deprecated.
use
goToDesktop(int) instead together with getHomeScreen()
LL.goToDesktop(id) -> getHomeScreen().goToDesktop(id)
| ||||||||||
void |
goToDesktopPosition(int id, float x, float y)
This method is deprecated.
use
goToDesktopPosition(int, float, float) instead together with getHomeScreen()
LL.goToDesktopPosition(id, x, y) -> getHomeScreen().goToDesktopPosition(id, x, y)
| ||||||||||
void |
goToDesktopPosition(int id, float x, float y, float scale, boolean animate)
This method is deprecated.
use
goToDesktopPosition(int, float, float, float, boolean) instead together with getHomeScreen()
LL.goToDesktopPosition(id, x, y, scale, animate) -> getHomeScreen().goToDesktopPosition(id, x, y, scale, animate)
| ||||||||||
boolean | isLocked() | ||||||||||
boolean |
isPaused()
This method is deprecated.
use
isPaused() instead together with getHomeScreen()
(difference: this function returns false if any screen is not paused, not only the HomeScreen. For an exact substitute check all the other screens too)
LL.isPaused(tag) ~> getHomeScreen().isPaused()
| ||||||||||
String |
loadRawResource(String pkg, String name)
This method is deprecated.
use
loadRawResource(String, String) instead
LL.loadRawResources(pkg, name) -> loadRawResources(pkg, name)
| ||||||||||
int |
pickColor(String title, int color, boolean hasAlpha)
This method is deprecated.
use
pickColor(String, int, boolean) instead together with an ActivityScreen
LL.pickColor(title, color, hasAlpha) -> 'pickColor' in getActiveScreen() ? getActiveScreen().pickColor(title, color, hasAlpha) : 0
| ||||||||||
Image |
pickImage(int maxPixels)
This method is deprecated.
use
pickImage(int) instead together with an ActivityScreen
LL.pickImage(maxPixels) -> 'pickImage' in getActiveScreen() ? getActiveScreen().pickImage(maxPixels) : null
| ||||||||||
float |
pickNumericValue(String title, float value, String valueType, float min, float max, float interval, String unit)
This method is deprecated.
use
pickNumericValue(String, float, String, float, float, float, String) instead together with an ActivityScreen
LL.pickNumericValue(title, value, valueType, min, max, interval, unit) -> 'pickNumericValue' in getActiveScreen() ? getActiveScreen().pickNumericValue(title, value, valueType, min, max, interval, unit) : 0
| ||||||||||
void |
runAction(int action, Item item, String data)
This method is deprecated.
use
runAction(int, Item, String) instead together with a Screen
LL.runAction(action, item, data) -> getEvent().getScreen().runAction(action, item, data)
| ||||||||||
void |
runAction(int action, String data)
This method is deprecated.
use
runAction(int, String) instead together with a Screen
LL.runAction(action, data) -> getEvent().getScreen().runAction(action, data)
| ||||||||||
void |
runAction(int action)
This method is deprecated.
use
runAction(int) instead together with a Screen
LL.runAction(action) -> getEvent().getScreen().runAction(action)
| ||||||||||
void |
runScript(String name, String data)
This method is deprecated.
use
runScript(String, String) instead together with a Screen
LL.runScript(name, data) -> getEvent().getScreen().runScript(name, data)
| ||||||||||
void | save() | ||||||||||
boolean |
sendTaskerIntent(TaskerIntent intent, boolean synchronous)
This method is deprecated.
use
sendTaskerIntent(TaskerIntent, boolean) instead
LL.sendTaskerIntent(intent, synchronous) -> sendTaskerIntent(intent, synchronous)
| ||||||||||
void |
setScriptTag(String tag)
This method is deprecated.
use
setTag(String) instead together with getCurrentScript()
LL.setScriptTag(tag) -> getCurrentScript().setTag(tag)
| ||||||||||
void |
setVariableBoolean(String name, boolean value)
This method is deprecated.
use
setVariableBoolean(String, boolean) instead
LL.setVariableBoolean(name, value) -> setVariableBoolean(name, value)
| ||||||||||
void |
setVariableFloat(String name, float value)
This method is deprecated.
use
setVariableFloat(String, float) instead
LL.setVariableFloat(name, value) -> setVariableFloat(name, value)
| ||||||||||
void |
setVariableInteger(String name, long value)
This method is deprecated.
use
setVariableInteger(String, long) instead
LL.setVariableInteger(name, value) -> setVariableInteger(name, value)
| ||||||||||
void |
setVariableString(String name, String value)
This method is deprecated.
use
setVariableString(String, String) instead
LL.setVariableString(name, value) -> setVariableString(name, value)
| ||||||||||
boolean |
startActivity(Intent intent)
This method is deprecated.
use
startActivity(Intent) instead together with getActiveScreen()
LL.startActivity(intent) -> getActiveScreen().startActivity(intent)
| ||||||||||
boolean |
startActivityForResult(Intent intent, Script receiver, String token)
This method is deprecated.
use
startActivityForResult(Intent, Script, String) instead together with an ActivityScreen
LL.startActivityForResult(intent, receiver, token) -> 'startActivityForResult' in getActiveScreen() ? getActiveScreen().startActivityForResult(intent, receiver, token) : false
| ||||||||||
void | unlock() | ||||||||||
void |
writeToLogFile(String data, boolean append)
This method is deprecated.
use
writeToLogFile(String, boolean) instead
LL.writeToLogFile(data, append) -> writeToLogFile(data, append)
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
This method is deprecated.
use bindClass(String)
instead
LL.bindClass(name) -> bindClass(name)
Translate a Java class into a JavaScript object. This is a convenience method that avoid repeated use of fully qualified names while scripting Java.
name | fully qualified class name |
---|
This method is deprecated.
use createAnimation(int, int, int, int, int)
instead
LL.createAnimation(width, height, count, duration, loopCount) -> Image.createImage(width, height, count, duration, loopCount)
Create a blank animation: frames are created fully transparent and need to be drawn. Notes: animations created this way are memory expensive and cannot be persisted (yet). This means that Shortcut.setCustomIcon() wont't work, but Shortcut.setImage() will.
width | image width |
---|---|
height | image height |
count | number of frames to allocate |
duration | default frame duration |
loopCount | initial number of loops to play, use 0 for infinite |
This method is deprecated.
use createImage(int, int)
instead
LL.createImage(width, height) -> Image.createImage(width, height)
Create a blank new image of the specified size. Pixel format is always ARGB 8888. Take care when creating images since it can rapidly exhaust memory and lead to a crash.
This method is deprecated.
use createImage(String)
instead
LL.createImage(path) -> Image.createImage(path)
Create an image from the specified file.
path | path of the image |
---|
This method is deprecated.
use createImage(String, String)
instead
LL.createImage(pkg, name) -> Image.createImage(pkg, name)
Create an image from a package and a resource name.
For instance: LL.createImage("net.pierrox.lightning_launcher_extreme", "icon")
The density used is either the one given by ActivityManager.getLauncherLargeIconDensity if available, or the current one.
pkg | name of the package, use "android" to access system resources. |
---|---|
name | name of the drawable resource |
This method is deprecated.
use createImage(Scriptable, int, int)
instead
LL.createImage(object, width, height) -> Image.createImage(object, width, height)
Create an image whose content is drawn using a script.
This can be used for memory efficient graphics and animations.
Please refer to ImageScript
for the documentation on how to use it.
object | the set of functions |
---|---|
width | the prefered image width, use -1 for as big as possible |
height | the prefered image height, use -1 for as big as possible |
This method is deprecated.
use createScript(String, String, int)
instead
LL.createScript(name, text, flags) -> createScript(name, text, flags)
Create a new script. Use this API wisely.
This method is deprecated.
use cropImage(ImageBitmap, boolean)
instead together with an ActivityScreen
LL.cropImage(image, full_size) -> 'cropImage' in getActiveScreen() ? getActiveScreen().cropImage(image, full_size) : null
Request the user to select an area in the image. Warning: because images need to be persisted to file while cropping, this method may be slow.
image | image to be cropped |
---|---|
full_size | handling big images can be slow or request too much memory, by setting full_size to false this will allow this method to downscale images (approx. the size of the screen) |
This method is deprecated.
use deleteScript(Script)
instead
LL.deleteScript(script) -> deleteScript(script)
Delete a script.
This method is deprecated.
use getAllDesktops()
instead together with getConfiguration()
(Difference: returns a java array instead of Array
, convert if necessary)
LL.getAllDesktops() ~> getConfiguration().getAllDesktops()
Returns an array of desktop identifiers.
This method is deprecated.
use getAllScriptMatching(int)
(Difference: returns a java array instead of Array
, convert if necessary)
LL.getAllScriptMatching(flags) ~> getAllScriptMatching(flags)
Return the collection of scripts matching some flags.
flags | see Script#FLAG_* |
---|
This method is deprecated.
use getContainerById(int)
instead with a Screen
LL.getContainerById(id) -> getEvent().getScreen().getContainerById(id)
Returns a container by its id.
This method is deprecated.
use getContext()
instead with a Screen
LL.getContext() -> getActiveScreen().getContext()
Return the Android Context this script is linked with (an activity context). This is meant to be used with Android services.
This method is deprecated.
use getCurrentDesktop()
instead together with getActiveScreen()
LL.getCurrentDesktop() -> getActiveScreen().getCurrentDesktop()
Returns the currently displayed desktop.
This method is deprecated.
use getCurrentScript()
instead
LL.getCurrentScript() -> getCurrentScript()
Retrieve the currently executed script.
This method is deprecated.
use getDesktopByName(String)
instead together with getHomeScreen()
LL.getDesktopByName(name) -> getHomeScreen().getDesktopByName(name)
Returns a desktop by its name, as set in the "Configure desktop" screen. The desktop name can be retrieved using getName()
.
This method will return null if no desktop by that name can be found
name | name of the desktop |
---|
This method is deprecated.
use getEvent()
instead
LL.getEvent() -> getEvent()
Returns the event object associated with this script execution. The event provides contextual data, such as the current desktop, which item has been tapped, and so on.
This method is deprecated.
use getContainerById(int)
instead together with getFloatingDesktopId()
LL.getFloatingDesktop(); -> getFloatingScreen().getContainerById(getConfiguration().getFloatingDesktopId())
Returns the desktop used as the floating desktop, or null if not set.
This method is deprecated.
use getContainerById(int)
instead together with getHomeDesktopId()
LL.getHomeDesktop() -> getHomeScreen().getContainerById(getConfiguration().getHomeDesktopId())
(note: in some rare cases getHomeScreen()
may return null. If necessary consider searching on getBackgroundScreen()
as an alternative)
Returns the home desktop. As of Lightning V14, this method looks for the desktop in the home screen, then in the background desktop.
This method is deprecated.
use getItemById(int)
instead together with a Screen
LL.getItemById(id) -> getEvent().getScreen().getItemById(id)
Returns an item by its id. This is a shortcut avoiding to traverse the list of all desktops and folders.
id | item identifier |
---|
This method is deprecated.
use getContainerById(int)
instead together with getLockscreenDesktopId()
LL.getLockscreenDesktop() -> getLockScreen().getContainerById(getConfiguration().getLockscreenDesktopId())
(note: in most cases getLockScreen()
may return null. If necessary consider searching on getHomeScreen()
or getBackgroundScreen()
as an alternative)
Returns the desktop used as the lock screen, or null if not set. As of Lightning V14, this method looks for the desktop in the lock screen, then in the home screen, and finally in the background desktop.
This method is deprecated.
use getOpenFolders()
instead together with getActiveScreen()
(Difference: returns a java array instead of Array
, convert if necessary)
LL.getOpenFolders() ~> getActiveScreen().getOpenFolders()
Returns the list of currently open folders. This function returns the opener item, not the container itself. This method will return null when the script is executed in the background.
This method is deprecated.
use getScriptById(String)
instead
LL.getScriptById(id) -> getScriptById(id)
Retrieve a script by its unique identifier
id | identifier as given by Script#getId() |
---|
This method is deprecated.
use getScriptByName(String)
instead
LL.getScriptByName(name) -> getScriptByName(name)
Retrieve a script by name
name | as given by Script#getName() |
---|
This method is deprecated.
use getTag()
instead together with getCurrentScript()
LL.getScriptTag() -> getCurrentScript().getTag()
This method is deprecated.
use getVariables()
instead
LL.getVariables() -> getVariables()
Retrieve the whole set of known variables (builtins and user ones).
This method is deprecated.
use goToDesktop(int)
instead together with getHomeScreen()
LL.goToDesktop(id) -> getHomeScreen().goToDesktop(id)
Go to a specified desktop, without changing the current position in this desktop.
id | desktop identifier |
---|
This method is deprecated.
use goToDesktopPosition(int, float, float)
instead together with getHomeScreen()
LL.goToDesktopPosition(id, x, y) -> getHomeScreen().goToDesktopPosition(id, x, y)
Go to a specified desktop and set the current absolute position in this desktop, setting a scale of 1 and using animations. This method does nothing when the script is run in background.
id | desktop identifier |
---|---|
x | absolute X position, in pixel |
y | absolute Y position, in pixel |
This method is deprecated.
use goToDesktopPosition(int, float, float, float, boolean)
instead together with getHomeScreen()
LL.goToDesktopPosition(id, x, y, scale, animate) -> getHomeScreen().goToDesktopPosition(id, x, y, scale, animate)
Go to a specified desktop and set the current absolute position in this desktop. This method does nothing when the script is run in background.
id | desktop identifier |
---|---|
x | absolute X position, in pixel |
y | absolute Y position, in pixel |
scale | zoom factor (1=100%, 0.5=50%, negative values are acceptable, 0 is not very useful) |
animate | whether to animate the move |
This method is deprecated.
use isLocked()
instead
LL.isLocked() -> isLocked()
Returns true if the screen is currently locked using the Lightning lock screen.
This method is deprecated.
use isPaused()
instead together with getHomeScreen()
(difference: this function returns false if any screen is not paused, not only the HomeScreen. For an exact substitute check all the other screens too)
LL.isPaused(tag) ~> getHomeScreen().isPaused()
Returns whether the current context is paused. It often means that Lightning Launcher is not displayed, for instance because another app is running. When the script is executed in the background this method always returns true.
This method is deprecated.
use loadRawResource(String, String)
instead
LL.loadRawResources(pkg, name) -> loadRawResources(pkg, name)
This method is used to load a text from a package raw resource. Instances of use of this method are:
pkg | package name from which to read resources |
---|---|
name | name of the raw resource. It must not contain the extension of the raw file, this is the Android identifier. |
This method is deprecated.
use pickColor(String, int, boolean)
instead together with an ActivityScreen
LL.pickColor(title, color, hasAlpha) -> 'pickColor' in getActiveScreen() ? getActiveScreen().pickColor(title, color, hasAlpha) : 0
Request the user to pick a color.
title | text displayed at the top of the dialog |
---|---|
color | initial color to display |
hasAlpha | whether to display the transparency slider. It will not enforce a fully opaque color, it only acts on the slider visibility. |
This method is deprecated.
use pickImage(int)
instead together with an ActivityScreen
LL.pickImage(maxPixels) -> 'pickImage' in getActiveScreen() ? getActiveScreen().pickImage(maxPixels) : null
Request the user to pick an image through the Lightning image picker screen. Warning: images returned by this function may be very large, take care at memory use as exceeding limits will make the launcher crash. Use the maxPixels parameter: the image will be scaled by a power of two so that its number of pixels is below or equal. This function supports picking bitmaps and nine patches.
maxPixels | maximum number of pixels in the returned image (width x height), 0 for no limit, 1048576 is one mega pixels (1024 x 1024) |
---|
Image
, or null if the user canceled the operation, or if the image cannot be loaded
This method is deprecated.
use pickNumericValue(String, float, String, float, float, float, String)
instead together with an ActivityScreen
LL.pickNumericValue(title, value, valueType, min, max, interval, unit) -> 'pickNumericValue' in getActiveScreen() ? getActiveScreen().pickNumericValue(title, value, valueType, min, max, interval, unit) : 0
Request the user to enter a numeric value. When using the "%" unit, valueType must be set to FLOAT: the dialog will scale a decimal value so that 0.75 is displayed as 75%. Warning: the returned value may be subject to rounding errors.
title | text displayed at the top of the dialog |
---|---|
value | initial value to display |
valueType | either INT or FLOAT. It will default to FLOAT if valueType is not a known value. |
min | minimum value for the slider |
max | maximum value for the slider |
interval | interval between values when sliding |
unit | text to display after the value (for instance "%" or "px"). When using "%" with FLOAT, scale value by 100 |
This method is deprecated.
use runAction(int, Item, String)
instead together with a Screen
LL.runAction(action, item, data) -> getEvent().getScreen().runAction(action, item, data)
Run a Lightning action. This method does nothing when the script is run in background.
action | action code (one of the values defined in EventHandler |
---|---|
item | item to be used as the target (only useful with actions requiring an item) |
data | optional data to send to be used by the action, use null if none |
This method is deprecated.
use runAction(int, String)
instead together with a Screen
LL.runAction(action, data) -> getEvent().getScreen().runAction(action, data)
Same as #runAction(int,Item,String) with a null item and data.
This method is deprecated.
use runAction(int)
instead together with a Screen
LL.runAction(action) -> getEvent().getScreen().runAction(action)
Same as #runAction(int,String) with a null data.
This method is deprecated.
use runScript(String, String)
instead together with a Screen
LL.runScript(name, data) -> getEvent().getScreen().runScript(name, data)
Run another script.
Optional data can be transmitted to the called script and retrieved using getData()
.
name | name of the script as found in the script editor |
---|---|
data | optional data to send to the script. Use JSON to pass more than a string. |
This method is deprecated.
use sendTaskerIntent(TaskerIntent, boolean)
instead
LL.sendTaskerIntent(intent, synchronous) -> sendTaskerIntent(intent, synchronous)
Send a tasker intent, optionally waiting for its completion to return.
intent | an intent built with TaskerIntent (see http://tasker.dinglisch.net/invoketasks.html for samples) |
---|---|
synchronous | when true, Lightning will wait for Tasker task completion before to return, otherwise it will return immediately |
This method is deprecated.
use setTag(String)
instead together with getCurrentScript()
LL.setScriptTag(tag) -> getCurrentScript().setTag(tag)
This method is deprecated.
use setVariableBoolean(String, boolean)
instead
LL.setVariableBoolean(name, value) -> setVariableBoolean(name, value)
Set a boolean variable. This is a shortcut for LL.getVariables().edit().setBoolean(name, value).commit();
. When modifying several at once, consider using the PropertyEditor
object instead for best efficiency.
This method is deprecated.
use setVariableFloat(String, float)
instead
LL.setVariableFloat(name, value) -> setVariableFloat(name, value)
Set a boolean variable. This is a shortcut for LL.getVariables().edit().setFloat(name, value).commit();
. When modifying several at once, consider using the PropertyEditor
object instead for best efficiency.
This method is deprecated.
use setVariableInteger(String, long)
instead
LL.setVariableInteger(name, value) -> setVariableInteger(name, value)
Set a boolean variable. This is a shortcut for LL.getVariables().edit().setInteger(name, value).commit();
. When modifying several at once, consider using the PropertyEditor
object instead for best efficiency.
This method is deprecated.
use setVariableString(String, String)
instead
LL.setVariableString(name, value) -> setVariableString(name, value)
Set a string variable. This is a shortcut for LL.getVariables().edit().setString(name, value).commit();
. When modifying several at once, consider using the PropertyEditor
object instead for best efficiency.
This method is deprecated.
use startActivity(Intent)
instead together with getActiveScreen()
LL.startActivity(intent) -> getActiveScreen().startActivity(intent)
Start an activity.
Example:
var intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.pierrox.net/")
LL.startActivity(intent);
intent | intent to start the activity |
---|
This method is deprecated.
use startActivityForResult(Intent, Script, String)
instead together with an ActivityScreen
LL.startActivityForResult(intent, receiver, token) -> 'startActivityForResult' in getActiveScreen() ? getActiveScreen().startActivityForResult(intent, receiver, token) : false
Start an activity and handle the result in another script. This is similar to http://developer.android.com/reference/android/app/Activity.html#onActivityResult%28int,%20int,%20android.content.Intent%29 This call is asynchronous and the script will continue its execution. Once the started activity ends, the "receiver" script is called with the following parameters set:
intent | intent to start the activity |
---|---|
receiver | a script to execute upon activity end |
token | an optional string data that you can transmit to the receiver script |
This method is deprecated.
use writeToLogFile(String, boolean)
instead
LL.writeToLogFile(data, append) -> writeToLogFile(data, append)
Write data to a file. This is for logging and debug purpose only. The path is not configurable and is: <external storage>/LightningLauncher/script/log.txt. Please note that this method won't add newlines automatically when appending data.
data | text to write to the file |
---|---|
append | whether to clear the file before to write data, or append data to the existing content |