Back

CreateShortcut

JS Py
Hello World

This method creates a shortcut of an app on your home screen - referencing to a js file runnable with DS.

app.CreateShortcut( name, iconFile, file, options? ) → void

Note: since Android 9 this method prompts a system dialog

See also: GetShortcuts

Example - Demo

function OnStart()
{
    var file = app.GetAppPath() + "/" + app.GetAppName() + ".js";
    app.CreateShortcut( "Demo", "/Sys/Img/Icon.png", file );

    app.ShowPopup( "Add Shortcut" );
}
def OnStart():
    file = app.GetAppPath() + "/" + app.GetAppName() + ".js"
    app.CreateShortcut( "Demo", "/Sys/Img/Icon.png", file )

    app.ShowPopup( "Add Shortcut" )
    Copy     Copy All       Run      
String
String: path to file ( “/absolute/...” or “relative/...” )
String: comma “,” separated: “Portrait” or “Landscape”, “Transparent”, Debug, Game or “remote”