Saving external data
There are many reasons you might want your app to be able to save information on a mobile device such as saving scores, game progress, settings, and more. This recipe demonstrates how to save data to a mobile device. While this specific example is for iOS devices, the same principles apply to Android-based devices.
Getting ready
Writing files on physical devices is more complex with mobile devices as opposed to desktop applications. All files are confined to the app's home folder or subordinate folder. Here are the initial folders that are created with a standalone mobile app:
Folder |
Use |
Sync'd by iTunes |
---|---|---|
|
Transient data (preserved between app launches) |
No |
|
Documents |
Yes |
|
App's binary files and bundled resources |
Yes |
|
The |
Yes |
|
Data not needed in between app launches |
No |
So, before you get started, you need to know where you will save your external files.