Knights
Knights

Reputation: 1477

Is it possible to create and store a json file using phonegap's file system and javascript

Am thinking of collecting user's data and store that user's data as a json file for retrival by javascript everytime the user uses the app, is it possible??

Upvotes: 0

Views: 1807

Answers (2)

Manish Kumar
Manish Kumar

Reputation: 1062

You can use the file API to write to the file system and store the JSON data.

Phonegap File API

Something as simple as this

function win(writer) {
    writer.onwrite = function(evt) {
        console.log("write success");
    };
    writer.write("some sample text");
};

Upvotes: 1

T.Baba
T.Baba

Reputation: 649

yes, you can do it. ether by storing it in sqlite (html5 local storage) or by creating a separate file, it can be js file, xml file or any type ;)

check phonegap documentation

Upvotes: 0

Related Questions