To manage application data, you can use the Filesystem API to access parts of the file system.
Accessible parts of the TV file system are represented as virtual root locations. The following are examples of virtual root locations:
"documents"
Directory for text documents in formats, such as DOC and TXT. Files in this directory are not removed when the application is uninstalled.
"wgt-package"
Read-only directory for application packages.
"wgt-private"
Private directory for application content. Files in this directory are removed when the application is uninstalled.
"wgt-private-tmp"
Temporary private directory for application content. Files in this directory are removed when the application is terminated or the Web runtime is restarted.
For information on how to manage removable storages on the device, see Handling USB Storages.
NoteIf you want to store less than 5 MB of data, use the Web storage.
Prerequisites
To use the Filesystem API, the application has to request permission by adding the following privileges to the "config.xml" file:
The file handle is returned in the success event handler, and is a reference object that points to and represents a file or directory.
To create files and directories:
To create a directory within the file system, use the createDirectory() method.
The directory is created relative to the current directory where the operation is performed.
if (documents_obj) {
documents_obj.createDirectory('sampleDir');
}
We use cookies to improve your experience on our website and to show you relevant
advertising. Manage you settings for our cookies below.
Essential Cookies
These cookies are essential as they enable you to move around the website. This
category cannot be disabled.
Company
Domain
Samsung Electronics
.samsungdeveloperconference.com
Analytical/Performance Cookies
These cookies collect information about how you use our website. for example which
pages you visit most often. All information these cookies collect is used to improve
how the website works.
Company
Domain
LinkedIn
.linkedin.com
Meta (formerly Facebook)
.samsungdeveloperconference.com
Google Inc.
.samsungdeveloperconference.com
Functionality Cookies
These cookies allow our website to remember choices you make (such as your user name, language or the region your are in) and
tailor the website to provide enhanced features and content for you.
Company
Domain
LinkedIn
.ads.linkedin.com, .linkedin.com
Advertising Cookies
These cookies gather information about your browser habits. They remember that
you've visited our website and share this information with other organizations such
as advertisers.
Company
Domain
LinkedIn
.linkedin.com
Meta (formerly Facebook)
.samsungdeveloperconference.com
Google Inc.
.samsungdeveloperconference.com
Preferences Submitted
You have successfully updated your cookie preferences.