what is application data directory ?
Hey guys,
i have created one Titanium application..
where is Applicationdatadirectory?,
How can i open it?
3 Answers
-
First, remember things are case sensitive so Applicationdatadirectory will not work; you need to call it applicationDataDirectory.
The Kitchen Sink app is generally the first place to look for example code. In this case, how to open a directory and list its contents, as well as how to create a new file etc can be seen by looking at the Kitchen Sink file at /Resources/examples/filesystem.js
-
API Reference to Titanium.Filesystem which is where the information on ApplicationDirectory is documented.
There is tons of getting started information available on the online documentation also
-
For iPhone:
var file = Ti.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory, 'example.txt'); file.write('lorem ipsum');
Then go into iTunes, select your device, click on 'Apps' and scroll down. Your app should be there along with files you have saved there.