Split app and content storage

Would it be possible to support having the app on device internal storage and media files on external storage? If the app and media files are both on external storage, when a user removes the SD card the app crashes. This way the user could keep using the app.
cc: @tfeyissa

Hi @ldewit
I’m not 100% sure here, hopefully @jbc25 and @jjoseba you can both give some opinions on this too (and correct anything I may have got wrong)…

The doesn’t store just the media files on the external storage, it also stores the course files (eg the actual html content, images etc) alongside this. This is likely why the app crashes, as it can’t find the course files when the SD card is removed (rather than not being able to find the media files).

Given our past experience in dealing with the internal/external storage issues, and varying permissions between different versions of Android, I suspect it would be very tricky to split these up reliably, and have (eg) course files on internal storage and the media files on external. Certainly it wouldn’t be something easy/quick. Plus of course they then wouldn’t have access to the media content

But… is there a reason why they need to remove the SD card regularly?


@alex @ldewit As we observed, users plug out SD cards when they want to switch SIM cards (SD card and SIM card container is the same on many tablets). They also plug out the SD to copy some personal files from elsewhere. Although they can safely shut down and do these processes, some times the don’t close the app itself and do unsafe removals. On other cases, I have also encountered the SD memory module looses reading the SD and a restart is needed. So in any case to be in the safe side what we have decided is to install everything on the internal storage. However, there is limited space on most of the user tablets. What we did was to move some of their personal files to SD or delete unwanted ones. Although this works too. It is also nice to have the media files be put on SD as an option. Definitely the multimedia files will grow as we add more courses, the all in all on internal storage option might not work in the future. If putting the multimedia files on SD can be possible development-wise, we can plan it in the future sprints. Note also that, the app and the rest of its content except the multimedia part should work as normal when SD is removed knowingly. A user can also re-insert back his/her SD and still be able to access the media files back if not deleted.

Thanks @tfeyissa (cc @ldewit )… it;s helpful to know about why they’re removing the SD card - as I can;t remember the last time I ever needed to do this on my own device.

For sure though in terms of tech dev and testing effort/time, for having the course files on internal storage and the media files on external, this won;t be about how many days, but rather how many sprints. Different devices and different versions of Android, esp going back to v5 of Android, all handle the external/internal storage and permissions differently. So there is a lot that can go wrong here on devices/configurations no matter how much we try to test. Unfortunately we know this from experience.

A more realistic option would be to check the app doesn’t just crash if the SD card has been removed, but that might still not account for the SD card getting corrupted if it;s been removed “unsafely” and they then re-insert the SD card.

As @alex said, the app right now is not prepared to handle SD card removal when the storage setting is set to “external”, so when it tries to find the courses files and that storage does not exists, there is an error.

The most straighforward solution would be to handle this case to avoid the crash and show a warning to the user asking him to introduce the SD card again.

It would be possible to set a different storage just for media files but it will need some time to make it work reliably in different Android versions/models.

Normally, users don’t use to remove often the SD card, I understand the behaviour of the users that want to use the SD card for personal files. I wonder if they could use the USB cable better than remove the card, it is safer not only for oppia app but for the system in general.

Thanks @jbc25, from what Tamene mentioned users are also removing the SD card so they can switch SIM cards, so unfortunately the usb cable approach won;t work for this.

Anyway, @tfeyissa & @ldewit I added a task on Jira (see: Log in with Atlassian account), but for now just to cover the situation of the app not crashing if the sd card is removed - instead giving a message to ask user to reinsert the sd card