Get the full application storage path in Phonegap
Phonegap gives me the freedom of creating mobile app with my existing knowledge of HTML, CSS, Javascript. It has a very nice javascript API to access the device features like camera, contacts, file etc.
There are times when you need know where your files are stored. Specially when you are providing the offline support of the app and want to store the files like images and then show the images from local system whenever user goes offline. I also had the same requirement in my project, let see how I did it for iphone
[java]
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function (fs) {
console.log(fs.root.fullPath)
//On simulator it will return something like /Users/intelligrape/Library/Application Support/iPhone Simulator/5.0/Applications/CF2A9018-49B9-4DE6-91FC-EA76CB435FC8/Document
})
[/java]
You can use this path in various cases like creating the full path of your files.
Thanks…what would I use to write the local path to the screen so I could see it?