Languages

Menu
Sites
Language
Problem manipulating file system

Hello.

I have been working on an app for Tizen in order to display it in Tizen TVs such as SamsungTV. This app has been developed using JavaScript. I have been able to make it work mostly okay, but one of the core functionalities revolves in being able to cache some images and .txt / .json files in the storage of the device. For this, I have studied the FileSystem API, but I think I'm missing something.

I have tried multiple functions related to tizen.filesystem but they don't work. I explain: while I can access the functions, it appears as if I don't... have any kind of storage? For example, I have used

/* Success event handler */ 
function checkCorruptedRemovableDrives(storages) { 
console.log(storages.length); 
} 
/* Search for the storages */ 
tizen.filesystem.listStorages(checkCorruptedRemovableDrives);

And this returns me a 0. I have also tried to use tizen.filesystem.resolve, returning me an error similar to "Cannot read property 'replace' of undefined" or something similar. I also have tried to access the files in order to check the structure through the Tizen Studio Device Manager, but also dead end. The File Explorer didn't show any files, folders, directories...

So I'm really stumped.

Oh, also, this is my config.xml file.

<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="http://pavjacko/ReactNativeVanilla" version="0.8.5" viewmodes="maximized">
    <tizen:application id="{{ID}}" package="{{PACKAGE}}" required_version="2.3"/>
    <content src="public/index.html"/>
    <feature name="http://tizen.org/feature/screen.size.normal.1080.1920"/>
    <feature name="http://tizen.org/feature/network.internet"/>
    <feature name="http://tizen.org/api/tizen" required="true"/>
    <feature name="http://tizen.org/feature/download" />
    <access origin="*" subdomains="true"></access>
    <icon src="icon.png"/>
    <name>{{APP_NAME}}</name>
    <tizen:profile name="tv-samsung"/>
    <tizen:privilege name="http://tizen.org/privilege/internet"/>
    <tizen:privilege name="http://tizen.org/privilege/tizen"/>
    <tizen:privilege name="http://tizen.org/privilege/filesystem.read"/>
    <tizen:privilege name="http://tizen.org/privilege/filesystem.write"/>    
    <tizen:privilege name="http://tizen.org/privilege/externalstorage"/>
    <tizen:privilege name="http://tizen.org/privilege/unlimitedstorage"/>
    <tizen:privilege name="http://tizen.org/privilege/mediastorage"/>
    <tizen:privilege name="http://tizen.org/privilege/tv.inputdevice"/>
    <tizen:setting screen-orientation="landscape" context-menu="enable" background-support="disable" encryption="disable" install-location="auto" hwkey-event="enable"/>
</widget>

Responses

1 Replies
Fierce Druid

Hi Gary,

I'm facing similar problems. I've been trying for days, reading back and forth all API documentation and I just can't wrap my head around this.

Have you found a solution to accesing files in Tizen?