Get the full application storage path in Phonegap

23 / Sep / 2012 by Uday Pratap Singh 1 comments

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.

FOUND THIS USEFUL? SHARE IT

comments (1 “Get the full application storage path in Phonegap”)

Leave a Reply

Your email address will not be published. Required fields are marked *