[Android] How do I use an SD card with Android 4.4 (Kitkat) or later?

Using CC V5 or later with Android 5 (Lollipop) or later:

CC V5 supports Android's "Storage Access Framework", so you can put your books anywhere on the SD card. When you use CC's Settings / Formats and Folders to change where your books are stored, CC opens an Android "chooser" where you can navigate to where you want to store your books. First open the drawer on the left by tapping the three lines in the upper-left corner or by swiping from left to right, choose which storage to use, then navigate to the folder you want to use. You can create folders in the chooser using the button showing a folder with a "+" in it.

Important:

if you don't see your SD card or main memory listed in the drawer, tap the three dots on the upper right and tap "Show SD card".

Do not use the private application folder required by Kitkat (see below). Some versions of Android 5 and later (especially Samsung) have broken access to that folder in very mysterious ways. For info, the folder to avoid is Android/data/com.multipie.calibreandroid/files

CC does not support this feature on devices running Android 4.4 (Kitkat).

Using CC V4 or earlier with Android 4.4 (Kitkat) or later, or using CC V5 or later with Kitkat:

Unfortunately, Android 4.4 Google has made using SD cards very difficult. For a variety of reasons such as preventing one app from tampering with another app's data, the SD card has in effect become "read only" for all folders except for one specific folder per app. If you click here to do a google search for kitkat sd card support you'll find lots of posts discussing this change, and explaining the pros and cons of Google's decision.

Google added more features in Android 5 (Lollipop) that made it practical again to support SD cards. Those features were not added to Kitkat.

The result: CC can write books only into on the SD card into a private files folder that gets deleted when you delete the associated app. Consequently a) there is only one folder on the SD card where CC can store your library, and b) that your library will be deleted from your SD card if you ever uninstall CC or cleared CC's data. To repeat: if you use Android 4.4 and put your library on an SD card, your books will be deleted if you uninstall CC. There is absolutely nothing we can do about this.

The name of an app's private folder is set by Android. For CC, that name is Android/data/com.multipie.calibreandroid/files

If you upgraded to KitKat and your library is in a no-longer-writable folder on the SD card, then there are three ways to recover:

You can root your device and remove the restriction. Not something we'd recommend or can support.

Option 1 also works to move your library from internal memory to your SD card, something you should do only if you accept that uninstalling CC or clearing its data will delete your books.

Important note for options 1 and 2: CC will be unable to delete the files from the old folder on the SD card. You must delete them yourself by putting the SD card into a card reader or using one of the few file manager apps that (currently) can manipulate SD cards.

The following documents one user's experience with option 1, documenting the steps he followed:

Quote:

Originally Posted by dfrye

Just a followup to V3.3.5 (Thanks chaley!!) for anyone with existing books on the sdcard. To start the conversion process you need to change the default dir for the books (app menu> Settings > "Book Formats and Folders") Note where the files are currently stored. You will need this info to manually clean up later. Tap on the default folder and get a dialog with a short summary of this thread. Click on the suggested folder name (not the Choose Folder button). The program will copy the existing books to the new folder. Make sure there is enough room on the sdcard for the copied books. It may take a while to copy. Once it is done you will get a error message for each of the books that it was not able to delete the old files. That's OK. At this point Calibre Companion will work normally. The old copy of the books are still on the sdcard. To free up the space you will need to delete the old books using other means. Either use a file manager that knows how to get past KitKat to the delete files on the sdcard or pull the sdcard and plug into a PC.

And another user's experience with adding an SD card to a new tablet:

Quote:

Originally Posted by kaufman

I just made an interesting discovery that should probably be added the the FAQ. I purchased a new tablet, and moved my SD Card with an existing calibre companion directory of ebooks to it. I deleted all the books with the file manager and tried to copy them again with CC. It didn't work. I needed to uninstall CC, delete the entire CC structure on the SD card and then reinstall CC. It recreated the directory and then everything worked.