언어 설정

Menu
Sites
Language
gear s2 - how to get accelerometer data to a file?

how to get accelerometer data to a csv file or any text file ?

I have no idea :(

please answer me.

 

Edited by: yk kim on 14 2월, 2016

Responses

2 댓글
AVSukhov

Hello,

you can try to use:

window.open("data:text/csv;charset=utf-8," + data);

as data you can stringify any json data

or you can use filesystem api to save data to file:

var newDir, newFile;
    tizen.filesystem.resolve("documents", function(dir) 
            {
               newDir = dir.createDirectory("newDir");
               newFile = newDir.createFile("newFilePath.txt");
               newFile.openStream(
                         "w",
                         function(fs) {
            	           fs.write("test test test");
            	           fs.close();
            	         }, function(e) {
            	           console.log("Error " + e.message);
            	         }, "UTF-8");
            });

 

rina you

If you want to get more informatio about tizen.filesystem API. 

Please, refer this link(https://developer.tizen.org/dev-guide/2.4/org.tizen.web.apireference/html/device_api/mobile/tizen/filesystem.html).

Thank you.