Well, I'm new to the Mac OS X platform and seriously I don't know anything about it. I mean on Windows I just store it at the Program's Files directory, What about the Mac, is there any recommended place to put the files?
Resources related to your application that will not be changed after the app is installed going into the app wrapper (see documentation).
Cached data that can be deleted at any time goes in ~/Library/Caches.
Supporting data that should generally be persisted, but isn't document data, goes in ~/Library/Application Support.
Documents and user data that is primary to the purpose of your app goes in ~/Documents, generally.
Preferences go in ~/Library/Preferences, but are generally read/written entirely via the NSUserDefaults API.
~/Library/Application Support/YourAppName/yourFilesHere
This way the files will be personal to the user using your app. If you want tho files to be global they should be in your app bundle/Resources/
To get the home directory ( the tilde ~ ) you can use NSHomeDirectory or you could use [#"~" stringByExpandingTildeIntoPath];
You can store your application-created / application-deependant files in ~/Library/Application Support/YourApp/Files. Otherwise, user created Documents would most likely be best stored in the Documents directory.
Related
I have asked this question so that they can respond that it is possible to create a shortcut for a file that is in the cloud, this access will be created in the device memory, what is the purpose of this: My application has integrated a function to upload a file to the cloud and then run it from a system application like player, gallery, among others, but without having to download anything, but from an application that is installed Installed on the device (nothing external). Thank you very much.
You may want to check Create a shortcut to a file. As mentioned,
To create a shortcut instead of a file stored in Drive, use the files.create method of the API and make sure you set the MIME type application/vnd.google-apps.drive-sdk. Do not upload any content when creating the file.
However, for Google Drive Android API, you may want to check Creating Files for more information.
Folks:
I'm creating an app using Node Webkit. The purpose of this app is to display images and pdfs. The app needs to download those files from a central repository, and cache them locally. When the app runs offline, the files should still be available, and displayed.
On the face of it, this sounds like appcache is the answer - and that indeed is where I was heading when this was a pure webapp in a browser. However, now I've discovered node-webkit, and here we are.
node-webkit's GitHub wiki states:
"However, application cache is designed for browser use, for apps using node-webkit, it's less useful than the other two method, read HTML5 Application Cache if you want to use it."
But doesn't say why.
I've also researched node.js filesystem - but that seems like a whole magnitude of complexity above what I need.
Can anyone point me in a sensible direction?
Thanks.
It has to do with the nature of App Cache itself.
You specify a manifest file that lists all the static assets required for your app to run offline. You don't have any programmatic access to the cache to add and remove files via JS.
So for a node-webkit app, it'd make more sense to fetch these files and store them in the Application Support folder (Or AppData, depending on the platform). That's where the node.js part is really useful, the file IO stuff.
My app runs on Android, iOS, WebSite, WindowsPhone, and now Windows 8. I use SkyDrive already. It's where I store the file(s) my app creates.
It would not be technically difficult to also store my app settings in SkyDrive. This would let me have a "unified" settings experience across devices. That's nice.
Is this allowed? I can do it "technically" can I do it "legally"?
It does not. SkyDrive does not preclude you from using the SkyDrive folders for a repository of a settings file (like a XAML file or something). It is not a violation of ToS.
This used to NOT be allowed. But, I have confirmed this change with a/the SkyDrive PM.
Warning! There is no protected area of SkyDrive for apps to store this sort of information. As a result, the user could delete or tamper with settings files at any time. If you decide to use SkyDrive to store these files, also create a mitigation plan if they are missing or damaged.
I was wondering if it is possible to make a new file inside the existing application? Now i am using:
[filemgr createFileAtPath: #"newFile.txt" contents: data attributes: nil];
But I think I have to change the path to something else. Anyone knows?
This is not a good idea. If the app is installed at /Application/ then only admin users launch the app will be able to write that file. (Never assume users are admins!)
The application might also be on read-only media.
If might also interfere with digitally signed applications though I'm not sure. Changing a file within the bundle means the app has changed, which is essentially what digital signatures want to avoid. (Don't mess with application bundles)
Instead, you should save a file on ~/Library/Application Support/<yourApplicationName>/.
Read File System Programming Guide.
I am wondering if there is a way in objective c to have my iPad app copy a file in it's documents folder to another app's documents folder and have that app open the file for editing and finally copy the file back to my documents folder. Or better yet, can I have another app open a file from my documents folder, edit the file, and save it back to my documents folder?
So far I know I can have another app open a file in my documents folder but the app that I'm handing the document off to seems to be making a local copy and editing the copy. I also know that each app's document folder is a shared folder that users can drag and drop stuff from itunes but I'm not sure if the same can be done in code.
I am pretty sure what you are trying to do is impossible. iOS applications are "sandboxed" which means that each app has its own documents directory. No application has access to the file system outside its own "sandbox" i.e. outside its own local documents directory.
For more on the iOS application sandbox, Read here.
Though a sandbox exists, I found a way to work around it (it's a trick being used by other File Manager apps like GoAruna). I would first register my app as an app that can open the type of files that I plan to work with. Then I use the Open In functionality to have my users open up my apps local documents in the second app, an app like iAnnotate. Then, because my app is registered as an app that can open the current file type, I can instruct my users to use Open In from iAnnotate to move the modified document back to my app. Sorry but I could not accept "no" as an answer. If anyone is interested in this approach, go here
If your iPad is jail broken, try this:
On the app iFile, type in the document name in the search box located at the top. Once you find the document, click on it and options would be showed to you. From here you can choose the app you want to open the file with.
Hope this helps.