Access the file system in Windows Phone using PhoneGap

I am new to Windows Phone (using PhoneGap). Where will the created file be saved when we write the file using PhoneGap? I also need to get the memory path on the phone.

 document.addEventListener("deviceready",onDeviceReady,false);    
    function onDeviceReady() {
        navigator.notification.alert("Device Ready");
        window.requestFileSystem(LocalFileSystem.APPLICATION, 0, gotFS, fail);
    }
    function gotFS(fileSystem) {
        fileSystem.root.getFile("TextFile3.txt", {create: true, exclusive: false}, gotFileEntry, fail);
        navigator.notification.alert("gotFS");
    }
    function gotFileEntry(fileEntry) {
        fileEntry.createWriter(gotFileWriter, fail);
        navigator.notification.alert("gotFileEntry");
    }
    function gotFileWriter(writer) {
        navigator.notification.alert("gotFileWriter");
        writer.onwriteend = function (evt) {
            console.log("contents of file now 'some sample text'");
            writer.truncate(11);
            writer.onwriteend = function (evt) {
                console.log("contents of file now 'some sample'");
                writer.seek(4);
                writer.write(" different text");
                writer.onwriteend = function (evt) {
                    console.log("contents of file now 'some different text'");
                    navigator.notification.alert("gotFileWriterEnd");
                }
            };
        };
        writer.write("some sample text");

    }
    function fail(error) {
        console.log(error.code);
    }
+3
source share
3 answers

I do not think that any Windows Phone 7 devices have access to an SD card, so this will not be possible.

+3
source

No devices have direct access to the SD card; the mechanism used to save / load persistent data is implemented through the isolated storage API.

You can find a detailed description here: MSDN - Isolated Storage

. "31 Windows Phone", .: 31 Windows Phone - .

+3

It seems to me that you are probably using one of the PhoneGap Storage APIs . Most likely, the localStoragestate of the documents "provides an interface for the W3C Storage interface" and indicates that it is supported on Windows Phone 7.

Now this does not mean that he is going to save any specific “SD card” (my phone does not even have one), but I assume that he will save it in isolated storage.

0
source

All Articles