We have received requests to support SD card storage for Pugpig apps on Android devices. There are three areas which come up in regard to the use of SD cards and applications:
- the ability to specify the app install location onto the SD card
- the ability for the app to store data it needs like content files
- the ability to support taking the SD card out of one device and inserting it into another device with the app continuing to work as it did before
Android users who may have limited internal storage built into their device like to be able to make use of SD storage for their installed applications. In Pugpig's case storing just the app (1.) isn;t that useful our app .apk files are small at around 6MB whereas an edition of content can often be around 40MB. This feature is only useful with the second part (2.) supported.
We've explained what we support, what Google and Android devices in general support and the considerations to make if you are interested in this:
1. App install location onto the SD card
Specifying the app storage location is trivial to do and we can support. You add a setting to the app manifest. The following rules can be used:
"preferExternal" - will attempt to install the app on the SD card if it exists and isn't full, otherwise internal storage is used
"auto" - indicates there is no preference - the installer will decide whether to use internal or SD card (if present)
no specification - internal storage is used always and the installer cannot override this
At the moment we do not specify by default. Our reason for this is because the ability to allow the user to move the app between SD card and internal storage is not always possible and is device specific.
However, please note that this Android functionality was far more limited than it is now:
1.1 Devices pre-Marshmallow (pre-Android 5)
While Android allows the APK files on the SD card, all other content used by the app continues to be stored on the internal storage. Hence the user's internal storage will still be holding the downloaded editions.
Note: The user would see an OS prompt on install asking them where they want to store this (great news they think!), they select SD but then realise the larger data files are still being stored on internal storage. We don't have control of the OS led message display either so can't help communicate that this won't always work as a user might expect.
1.2 Devices since Marshmallow (Android 5+)
Android now allows installing the APK files and all content files on the SD card, provided it has been formatted by the user as internal storage. This would result in all the content being stored on the SD card. It is worth noting Android's guidelines though: this approach does not work for users frequently removing the SD card while the device is running as it could lead to application crashes. In addition, as the data is encrypted specifically for the original device, if the SD card is moved to another device, the new device will be not able to use it. It must be considered as strictly a way of increasing the "internal storage" space available to the device.
2. App data on the SD card
Content otherwise stored on the SD card is not secure. You can view and copy the content even without rooting the device. Strategies for overcoming this include the app encrypting the data itself, but there are performance and support concerns that then arise. In addition, any implementation would be vulnerable to circumvention. Currently, Pugpig does not support this approach.
3. SD card removal and inserted into another device
We have not done anything specific to handle the case for when the SD card is not available/there.
Unfortunately, when mounted as "internal storage" you can't just plug an SD card into another phone and expect the app to work either. See http://android-developers.blogspot.co.uk/2010/07/apps-on-sd-card-details.html: "Applications on SD card are mounted via Linux's loopback interface and encrypted via a device-specific key, so they cannot be decrypted in any other device." This is one of the things our customers have asked for but we don't think it's possible. It makes sense - it's an attempt to limit app piracy.
References:
http://developer.android.com/training/basics/data-storage/files.html
http://developer.android.com/guide/topics/data/data-storage.html
http://developer.android.com/distribute/essentials/quality/core.html
http://www.androidcentral.com/kitkat-sdcard-changes
http://android-developers.blogspot.co.uk/2010/07/apps-on-sd-card-details.htm
http://blog.laptopmag.com/move-apps-sd-card-android
Comments
0 comments
Please sign in to leave a comment.