2016-02-06, 22:56
(2016-02-06, 11:25)Koying Wrote: Yeah, sorry about that, not our fault, really.
I've started digging into the Android api, but it really, really does not fit a native, cross-platform, app as Kodi.
Thanks for the detailed explanation. If you make a new thread with a "howto" (basically the post above with a bit of context), I'll stick it.
HOWTO: Move Kodi's data to external memory on an Amazon Fire TV
Short version for the Amazon Fire TV (AFTV):
- Create a file on your AFTV called, "/mnt/sdcard/xbmc_env.properties"
- xbmc_env.properties contains one line to tell Kodi where you're data is located
- This line should read: xbmc.data=/usbdisk/Android/data/org.xbmc.kodi/files
- "usbdisk" is the name of a flash drive plugged into the usb port. Verify this location
- Changes to Android permissions require that the path for Kodi data on your external device be /Android/data/org.xbmc.kodi/files
- Copy your settings to the USB drive
- If your settings are on internal storage, copy the contents of: /storage/emulated/0/android/data/org.xbmc.kodi/files to /usbdisk/Android/data/org.xbmc.kodi/files
- Mount the external storage on your AFTV
Kodi should now load it's library and user settings from your external device.
Long version:
Recent upgrades to Android OS have changed the access premissions of the SD card and USB drives. These changes require your attention when attempting to relocate your Kodi data to secondary storage.
Quote:Note: When the permissions changed the update happened automatically by the device and this cannot be blocked on a Amazon Fire TV without rooting. After the update, Kodi would launch and hang on a blank screen, or launch and then immediately fail. Before the upgrade Kodi had been working flawlessley. The change was very disorienting since an update to the OS had not been requested, but instead pulled by the device.
These instructions were written up based on an Amazon Fire TV running version 5.0.5 of the AFTV OS. They should also offer you enough insight to update other Android devices which will behave similarly once their Android OS has been updated to include these permission changes.
After the permission changes you can only move your data to a place that your application is allowed to write.
To move your data from internal storage to external you must place it in the folder:
Code:
/<external_device_name>/Android/data/org.xbmc.kodi/files
Using the USB port and a san disk USB drive on the AFTV, for example, the <external_device_name> is called usbdisk. On that device the files were placed in the folder:
Code:
/usbdisk/Android/data/org.xbmc.kodi/files
To move your data, follow these steps.
Create a file called, "xbmc_env.properties", it should have one line in it that tells Kodi where you're data is located.
Code:
xbmc.data=/usbdisk/Android/data/org.xbmc.kodi/files
Put "xbmc_env.properties" in the root of your internal storage. On the AFTV this should be /mnt/sdcard so put the file at the following file path:
Code:
/mnt/sdcard/xbmc_env.properties
Copied your Kodi data files to new location (/usbdisk/Android/data/org.xbmc.kodi/files). The Kodi data folders start with a period ("."). On the configuration used for these instructions these folders were called:
- .kodi
- .smb
If you initially install Kodi on internal storage and move these folders to external on the AFTV you will find them at:
Code:
/storage/emulated/0/android/data/org.xbmc.kodi/files
Quote:Note: Remember that on Android these folders can be mapped to multiple paths. The path above is not the only one to which the folder above has been mapped so if you look around your device you can likely get to the data files multiple ways. Use these instructions as a guide, but your mileage may vary.
Inside the internal data folder for Kodi (/storage/emulated/0/android/data/org.xbmc.kodi/files) you should see folders beginning with a period (".kodi"). These are the folders that should be placed into the folder listed in your "xbmc_env.properties" file.
xbmc_env.properties is detected by Kodi during startup and, if found, Kodi reads it to locate it's data. If this location is incorrect, Kodi will not start or hang will hang on a blank screen. If you don't have an external drive mounted or the path in the xbmc_env.properties file does not exist, Kodi may ignore it and load, but of course it will be using the settings from internal memory. If there are no settings on your internal memory it will create them and use the default settings.
To push the "xbmc_env.properties" to the AFTV, created the "xbmc_env.properties" where adb.exe is located and use these commands. Substitute your devices IP address for xxx.xxx.xxx.xxx (you can find your device's IP address in the settings under network).
Push "xbmc_env.properties" to the Fire TV with these commands:
Code:
adb connect xxx.xxx.xxx.xxx
adb push "xbmc_env.properties" "mnt/sdcard/xbmc_env.properties"
adb disconnect
Copy your Kodi data files (.kodi, etc) to your external storage device at the location listed in "xbmc_env.properties" and put the storage device into the AFTV. When you launch Kodi it should find the "xbmc_env.properties", be redirected to use the new data location on your external device, and load.
One advantage of using an external device is that you can easily backup your settings from time to time. To do so, go into Kodi and under "System Settings->Video->Library->Export video library" - this will update the play counts and any edits you've made via the Kodi interface. Whether you use the single file export or separate file export depends on the way you've setup your library. You may want to "Clean library..." before exporting.
After exporting your library, quit out of Kodi, go into the settings and eject the external device, take it to your computer and backup the /Android folder or more specifically the folders at /Android/data/org.xbmc.kodi/files.
Happy watching.