Moving Android app storage to external SD..
So, in the aftermath of Cobalt's hack to enable Google Play, obviously, I've been downloading a lot of Android apps, and have filled up my device file system, and I'm sure many others have done the same..
It would be nice to be able to move Android apps themselves to SD card (tried this in the past from the hidden Android settings panel, but it broke things badly, so don't bother with this approach for now; maybe this can be Cobalt's next trick??), but to move the app storage (which can be quite a storage load, especially for many games, etc) to external micro SD card is actually pretty straightforward due to the way BlackBerry decided to make the SD card visible in the Android file system.. Basically the process is to move the storage directory off internal storage to the external SD card, and then create a symbolic link to point to where you moved things.. Everything I've tried to date works perfectly with this method and it has freed up a huge amount of internal storage.. I wish BlackBerry10 apps could do this, but unfortunately, most of these store their app data in their app directories which are inaccessible due to the security model..
To create the symbolic link, you need either a shell app (there are a couple of old PlayBook shell apps still in BlackBerry World that still work- I chose BGShell), or to turn on development mode and upload a token, etc and ssh in from a desktop.. If there is a file manager app that can create symlinks (I'm not aware of any, but I didn't look very hard either), you can use that instead of the command line interface of the shell..
First of all, make sure the Android app you want to move storage is *NOT* running.. Then, all you have to do is move or copy the app's storage directory from misc/android to a directory on your SD card (I just created another directory called 'android'). You can do this from the shell if you're a Unix geek, or use your favorite file manager app (the BlackBerry10 native file manager works fine for this). If you're doing this for the first time, I'd recommend you do a copy vs. a direct move, just in case.. If you do a copy, then after you copy, you need to rename the original storage directory in internal storage to something else, so that you can create the symlink in its place (and then, on the off-chance that it doesn't work, you can delete the symlink and just rename the directory back to its original name and everything should work again)..
Once you've moved, (or copied and then renamed the original), open up the shell app, or ssh in from your PD and navigate to the /accounts/1000/shared/misc/android directory, and then use the command 'ln -s external_sd/<where you copied the directory> <original name of directory>' and you're done..
So here's a practical example: since I upgraded to the latest 10.3.1, the BB10 offline GPS app that I use: Mireo, has stopped working (opens to black screen, then crashes), but luckily, this app is also available as an Android version, so I downloaded it, and it works like a charm, *BUT* unlike the BB10 version, the Android version doesn't support BB10's method of storing the several gigabytes of map data on external SD card, so it insists on saving things to internal storage, which as I mentioned earlier, I'm rather short on..
OK, Mireo stores its data in the shared files tree. The full path is /accounts/1000/shared/misc/android/Dontpanic. I need to move this directory off to the external SD card, where I have huge amounts of room on a 64Gig card.
My first task is to prep the external SD card: because the BB10 version of this app also creates a "Dontpanic" directory on the SD card, and the developer will hopefully eventually get around to updating the BB10 app, I chose not to rename it or to allow the Android version to overwrite (although it seems to use exactly the same data files; the Android version leaves some licensing files here that the BlackBerry version stores in its internal directories), so using the BlackBerry file manager, I navigate to the "Media Card", by tapping on the 3 bars at lower left corner of the screen, then I tap on the 3 dots on the lower right corner, and select "Add Folder". Again, in my case, I chose to create a directory called "android"
Next task is to move the Android app's storage out to the SD card, so I tap on the bottom left again, and go back to "Device", which puts me in the shared folders section, then select the "misc" folder and then the "android" folder inside that.. Now you should see all the various app storage folders that your Android apps have created.. So, in this case, I find the "Dontpanic" folder, long-press on it until the side menu comes up, and select "Move", then I go through the long process of tapping on the bottom left several times to go up the directory structure, until I'm able to select the "Media Card", then I find the "android" folder I created previously, and once I'm inside, I tap the "Move" button at the top of the screen and then I wait for all the files to be moved over.. If you decided to "copy" instead of "move", at this point, you need to go back up to the device storage, back to the misc/android folder, then find the app storage folder again and long press, and this time select "rename" and change the name of the directory to something else (I usually just add ".old"). If you want to do this from the shell, you simply navigate to the misc/android directory, then go "mv Dontpanic external_sd/android"
Then I open up my shell app, and navigate to the android directory with the Unix shell command:
"cd /accounts/1000/shared/misc/android"
Then creating the symlink with: "ln -s external_sd/android/Dontpanic Dontpanic", and I'm done.. I can exit the shell and try starting up the app, and everything should work just as before, except that all its files are now stored on the external microSD card vs. the limited internal device storage.. If you made a copy of the files to external SD vs moving, once you confirm that the app still works, you can simply delete the renamed original folder
If you download games that save their level files in the shared files, then you can move these off to external storage in the same manner.. Because the symlink affects things at the filesystem level, most apps will be completely unaware that you've made this change and should work just fine.. Now of course, if you remove the microSD card and try to start an app whose storage was on the card, unpredictable things might happen: the symlink still points to the card, but there's nothing there to read or write..
Anyways, thanks again to Cobalt for his work; I hope this simple little trick is useful to everyone, and happy downloading..