Cordove File Instance Demo
I.. cordova.file Get System directory
[javascript] View plain copy//directory of the current program Console.info (cordova.file.applicationDirectory); //Program Data Directory console.info (cordova.file.applicationStorageDirectory); //Program Data Directory console.info (cordova.file.dataDirectory); //program's Staging directory Console.info ( cordova.file.cacheDirectory); //android extended storage App Catalog console.info ( Cordova.file.externalApplicationStorageDirectory); //android Extended Storage Data Catalog Console.info ( Cordova.file.externalDataDirectory); //android Extended Storage Cache directory Console.info ( cordova.file.externalCacheDirectory); //android extension root directory Console.info ( cordova.file.tempDirectory) Directories in; /**ios **/ //Temp directory Console.info ( Cordova.file.tempDirectory); //Cloud storage directory console.info (cordova.file.syncedDataDirectory); //Document Catalog Console.info (Cordova.file.documentsDirectory); //shared directory console.info (cordova.file.sharedDirectory); Android under directory output
[HTML] View plain copy//file:///android_asset///file:///data/data/io.cordova.myapp84ea27///file:///data/data/io.c ordova.myapp84ea27/files///file:///data/data/io.cordova.myapp84ea27/cache///file:///storage/emulated/0/android /data/io.cordova.myapp84ea27///file:///storage/emulated/0/android/data/io.cordova.myapp84ea27/files///file:/// storage/emulated/0/android/data/io.cordova.myapp84ea27/cache/
Second, the sandbox mode of direct operation
Window.requestfilesystem (type, size, SUCCESSCB,ERRORCB), request a quota, do not need to use Requestquota in the plug-in
1. Create a file
[JavaScript] View plain copy