Write data to file in Titanium

var configDir = Titanium.Filesystem.getFile( Titanium.Filesystem.applicationDataDirectory, "dirPath" );
       
    if ( configDir.exists() ) {
         configDir.createDirectory();
     }

var config = Titanium.Filesystem.getFile( configDir.resolve(), "fileName" );
       
    if ( config.write( writeSettingToConfig( userID ) ) == false )
    {
        // handle write error
        var error;
    }
    config = null;
    configDir = null;

Comments

Popular posts from this blog

Drawing textured cube with Vulkan on Android

glTF loader for Android Vulkan

C++ unit testing & CI integration in GitHub (I/2)