Data storage

Our approach to data storage differs according to the operating system used with our SoSporty application.

Android provides several options to save application data. Android provides 2 storage options for files – Internal and External. Internal is private to the app. External is world readable and accessible to all. External can be a partition of the internal memory or a removable storage media (like an SD card) or both. the different data storage options available on Android are:

  • internal file storage: Store app-private files on the device file system.
  • External file storage: Store files on the shared external file system. This is for shared user files, such as photos and videos.
  • Shared preferences: Store private primitive data in key-value pairs.
  • Databases: Store structured data in a private database.

iOS Data Storage Everything in app’s home directory is backed up, with the exception of the application bundle itself, the caches directory, and temp directory. Anything is Purchased is backed up as well. Because backups are done wirelessly and stored in iCloud for each user, it’s best to minimize the amount of data that’s stored in our app. Large files will lengthen the time it takes to perform a backup and consume more of a user’s available iCloud storage. To ensure efficient as possible, app’s data will be stored according to these options:

  1. Only documents and other data that is user-generated, or that cannot otherwise be recreated by the application, should be stored in the Documents directory and will be automatically backed up by iCloud.
  2. Data that can be downloaded again or regenerated should be stored in the Caches directory. Examples of that include database cache files and downloadable content, such as map applications.
  3. Data that is used only temporarily should be stored in the temporary directory. Although these files are not backed up to iCloud they should be deleted when done with them so that they do not continue to consume space on the user’s device.
  4. Use the attribute “do not back up” for specifying files that should remain on the device. Usable with data that can be recreated but needs to persist even in low storage situations for a proper functioning of the app or because users expect it to be available during offline use. these files do use on-device storage space, your app is responsible for monitoring and purging these files periodically.

 

References

https://developer.android.com/guide/topics/data/data-storage

http://codetheory.in/android-saving-files-on-internal-and-external-storage/

https://developer.apple.com/icloud/documentation/data-storage/index.html

 

Data storage
SoSporty!

Post navigation