Google recently introduced stricter target API level requirements for applications published to the Play Store. ODK Collect currently targets Android 9 but as soon as Android 11 is released, it will need to target Android 10. This will likely be in fall 2020.
This has two major implications: Collect will no longer be able to use files in /sdcard/odk/
and it will no longer be able to read device-unique identifiers such as the International Mobile Equipment Identity which is used as deviceId
(sent with every form submission and form list request). Because these may have impact across the ecosystem, I'll start a thread for each change describing a proposed approach and soliciting feedback. See Collect will need to stop using IMEI as deviceID and making simSerial and subscriberID available for the thread on deviceId
.
The /sdcard/odk/
folder that has always been used by Collect to store blank forms, submissions and corresponding databases in a public folder on the device that any application can access. For security purposes, Android will no longer allow folders shared between applications. Collect will instead need to use a folder that only it can see and write to ("scoped storage").
As far as I know, these are the implications:
- When ODK Collect is uninstalled or downgraded, all files including unsent submissions will be deleted
- If users want to manually push files from a computer to their device, they will need to use a path like
/sdcard/Android/data/org.odk.collect.android/files
- It will no longer be possible for other applications to directly read or modify ODK Collect files (e.g. generate or modify submissions, read form definitions)
- It will be impossible to use ODK Collect versions prior to the ones with this storage change on Android 11+ devices
@Grzesiek2010, @seadowg and I have spent quite a bit of time exploring our options and would like to propose the following course of action:
- Let users know that these changes are coming with a community announcement
- In the upcoming v1.26 release, have new installs use the dedicated Collect directory. This means that these users will not need to undergo any kind of data migration.
- Either in v1.26 or in the following release, put a notice on the Collect landing screen that files need to be moved and let the enumerator make the change by tapping a button when it is appropriate for them (e.g. when all pending submissions have been sent). We are proposing to let users explicitly trigger the data migration because it could take a while depending on storage speed, whether sent submissions were deleted and whether media files were captured. Having it be user-triggered will also make it easier to recover from any errors that may happen during the migration.
- In the summer release (before August 2020 and the requirement to target Android 11), on devices where the files haven't already been moved, force the move on first load of this version. After the change to scoped storage is made, it will be impossible for Collect to migrate files out of
/sdcard/odk
so users who upgrade after will not have blank or filled forms available. They should be able to manually move the files usingadb
, however.
Please provide any feedback you may have on this approach. Are there implications we may not have considered? Do you have alternate suggestions on how we make this change as seamless as possible for users?
OpenMapKit is one application that I know reads contents from /sdcard/odk
and will need to change (@danbjoseph). The Skunkworks Crow project for sharing form definitions and filled forms between devices will need to make a similar modification for itself. I'm not sure what the best approach will be for reading and writing form definition and submission XML but I think it should be possible using FileProvider
functionality. @Shobhit_Agarwal, @dexter21, @Mickys0918 is this something you've explored? I think it will require changes to Collect. Do we know of other Android applications that do things explicitly with the /sdcard/odk
directory? @Jason_Rogena (Ona)?
CC @tomsmyth (NEMO), @Ukang_a_Dickson (Ona), @jnm (Kobo)