Back

RedirectAssets

JS Py
Hello World

Reads the assets folders “Img”,“Snd”,“Html” and “Misc” from an external folder outside the apk.

app.RedirectAssets( dir )

Example - Redirect Assets

function OnStart()
{
    app.RedirectAssets("/sdcard/DroidScript/Hello World/");

    lay = app.CreateLayout( "Linear", "VCenter,FillXY" );

    img = app.CreateImage( "Img/Hello World.png" );
    lay.AddChild( img );

    app.AddLayout( lay );
}
from native import app

def OnStart():
    app.RedirectAssets("/sdcard/DroidScript/Hello World/")

    lay = app.CreateLayout("Linear", "VCenter,FillXY")

    img = app.CreateImage("Img/Hello World.png")
    lay.AddChild(img)

    app.AddLayout(lay)
    Copy     Copy All       Run      
String: path to folder ( “/absolute/...” or “relative/...” )