[HOW-TO] Write Data to Your External SD Card in KitKat Without Root (Many Apps) - Android General

I saw a question here in XDA where a person was asking how his torrent app could save downloads to the external SD card without root, in KitKat. This can actually be done, with many apps.
Surprisingly, there were no answers, except to tell him to root. That is not always the case! I've been saving and writing data to my external SD card since I got my KitKat device and, I am not rooted. I didn't know this was not a well known technique, or I would have posted this information a long time ago. I just did an internet search (to see if it was well known or not) and it came up empty! But, if this method is common knowledge and I just missed it (wrong search criteria, for example), I apologize!
With KitKat, you do not have to be rooted for many apps to be able to write to an external SD card, if you follow Google's guidelines!
Let me explain via an example:
One main requirement is that the app in question can actually see and use the external SD card - some cannot. Also, please be aware, depending upon your device manufacturer, the path examples given in this explanation may vary.
For the example, I am going to use a made-up app called MyTorrent. Let's say MyTorrent has a home-directory of '/storage/emulated/0/Android/data/com.company.mytorrent/files' where it stores its downloads, but you want it to save the downloads to the external SD card instead of internal memory. With many apps, this is easily and completely doable!
To have MyTorrent use the external SD card to save its downloads, you need to first make sure a home-directory was created for MyTorrent on the external SD card. There should be an Android directory on the external SD card, just like there is in internal memory. An app's external home-directory path will look a lot like its internal home-directory path, something like: '/storage/extSdCard/Android/data/com.company.mytorrent/files'. If the app you are setting up does not have a home-directory on the external SD card, just create one manually (use the internal home-directory path as a template).
Finally, just point MyTorrent's download location to its external SD card home-directory! As long as you can select the external home-directory path as the app's download destination, it should work. If this technique doe not work, it is usually because of how the app is written or, you got the external SD card home-directory wrong. Google set KitKat up so that any app has write permission to its own external SD card home-directory.
This is not a perfect answer and does not open up the external SD card for KitKat's use carte blanche, but it will help free up a lot of wasted, limited internal memory.
This method also works for file managers. Unfortunately, only their external home-directory will be available to them, but it is a good place for manual copy-type backups and zips.

Gonna check it out with my torrent. I saw this thing in Snap Camera app, when I wanted to save videos in SD card, but it saved in its directory, not anywhere else.(but I didn't understood that it can only save in its dir)

DarkLTU said:
Gonna check it out with my torrent. I saw this thing in Snap Camera app, when I wanted to save videos in SD card, but it saved in its directory, not anywhere else.(but I didn't understood that it can only save in its dir)
Click to expand...
Click to collapse
I use Flud, and it works fine for me. But, like you reiterated, it must use its own home directory.
BTW, it works (in most cases) the same way with Lollipop, too.

Related

Apps to SD questions (please)

Okay XDA tenured- please be gentle. I ve searched, but can not find specific answers to my questions. I ordered a 16gb class 6 (currently have class 2), but would appreciate information before making the changes.
1.) Is it possible to leave current apps on the device memory, then set up for apps to SD and then future apps will go to the card?
2) Based on question 1) if it works, when I update future apps on the device, I am guessing they would then uninstall from the device and then install to card?
3) Would it be best for performance to leave all cache on the device memory? Seems like the system would be faster then.
4) What is the meg space difference leaving all cache or moving it?
5) When changing over to apps to SD, is it not kind of like the same constrained system as an iPhone (Plenty of intitial space, but no ability for external storage)? Point being, if all the apps are on the card and you want to listen to or view media on a seperate card, you would not be able to, since the apps are on the "device" card. This is the whole point to my first question. Unless you can copy the app directory path on the card to another card and use as is- just like the card already installed too...
1: Yes, if you follow my tutorial, it has you copy the existing apps to the sd card and if you use my app, the checkbox tells it to do that as well.
2: No apps will be on your device. There's no way to have a hybrid here, it's either all apps on the sd card or none(not actually true but would be a pain in the ass to make symlinks for each app individually and I don't know of anyone who cared enough to actually try it)
3: I have all apps and caches on the sd card and it is running just as smoothly as normal(and with a class 2 sd card!) There might be some slowdown but it's imperceptible to me.
4: With the cache on device it'll vary depending on what apps you have and how often you use them. With everything moved the memory on the device seems to stay permanently at 72-73MB. That said, moving the normal cache(dalvik-cache seems to be ok) is pretty unstable and I wouldn't suggest it unless you really know what you're doing.
5: Yes, unfortunately this whole process relies on the system not knowing the apps are on the sd card so it's pretty strongly tied to one. That said, you could probably get away with different sd cards as long as they also have an ext2 partition with the app, app-private, etc. directories in it. You'd probably have to reboot when switching sd cards but it should be possible(interestingly you could use this to get different settings depending on what sd card you have in)
Thanks!
So basically we have an iPhone in regards to being stuck to device memory and no option for external storage beyond what is on the card.
I guess there are pros and cons to either set-up. App hounds would prefer apps2sd and media hounds may prefer leaving things alone.
If you are an app and media hound, you are kind of stuck juggling media from the card.
Yep. Although as I was talking about, you could theoretically move each app independently and set up symlinks in the /data/app directory for each app, pointing to where it is on the sd card and leave the ones you want on the phone as they are, but that doesn't sound particularly fun.

speed up your sd card

This may be obvious to some people but not all...myself included
If you find that your apps/games (or anything else) stored on your sd card are starting to take longer to load than usual, try connecting it to your computer and running disk defragmenter (or whichever program you prefer).
I did it to mine after a good 6+ months of use and found that it was heavily fragmented (took a few hours to complete on class 2 8gb so left it running overnight!)
If that doesn't make much difference then you might want to invest in a higher class sd card which of course will give you faster read/write speeds
EDIT: sorry i just realised this is in the wrong section!!!
To have more of an impact you can change the readahead value in sys/devices/virtual/bdi/179:0/read_ahead_kb from 128Kb to whatever suits your SD card type. In my case 2028Kb.
This cannot be achieved just by editing the file as it is overwritten on boot. Google for it or search market if you want an app to do it for you if you are rooted. Tasker works also.
Using a PC to defragment your phone's SD card can be bad. Bad as in, the computer will treat your SD card as if it's some memory expansion to itself. It will move files to places where it "thinks" they should be but actually they're in the correct place for the device. This is based on past experiences when I did it and that's exactly what it did. Example in the Android Secure folder (asec files), it caused apps which were moved to the SD card to have corrupted data (cause it depleted the values of some of the asec files). The method nobnut stated is the better option.
If you must do it on a pc, rather than use Windows own defragmenter, use an SD defragmenter program, like http://panasonic.jp/support/global/cs/sd/download/index.html.

Save to MicroSD?

This is my first tablet so please forgive these dumb questions. I've been spoiled for years with CM# on my phones so I'm having a hard time adapting.
Is there a way to force apps to use the MicroSD card when saving? Example: In Dolphin HD, you can set your download directory. It defaults to "/mnt/sdcard" which is internal memory. I want to change it to "/Removable/MicroSD" but it keeps telling me that path is not available and to pick another. I googled a bit but all they tell me to do is save to internal then copy to external. I know I'm going to get tired of that really soon...
Some apps allow me to save to the external card. I set K-9 to download attachments to the card and it took the path but when I actually save an attachment, it says it's successful but I can't find the attachment in either internal and external memory. And yes, I did confirm I typed in the right path.
Any suggestions?
TIA
I don't know if this is the issue, but ASUS has decided to mount the external memory cards under a directory in the root directory ("/Removable/microSD" and "/Removable/SD"). Have you rooted your TF700? Most other systems I've used (the SGS2 primarily,and the LG O2x) had the external cards mounted under /mnt/sdcard/(_)External_SD, or under "mnt/emmc" as is the case under CM#. It might drop down to not having write access to these directories (although that'd be strange and never encountered efore on my devices, at least)...
EDIT: under Opera, for example, I can save an embedded image on XDA on the external microSD and I can find it with Total Commander (and open it with QuickPic).Still, I'm rooted.
MartyHulskemper said:
I don't know if this is the issue, but ASUS has decided to mount the external memory cards under a directory in the root directory ("/Removable/microSD" and "/Removable/SD"). Have you rooted your TF700? Most other systems I've used (the SGS2 primarily,and the LG O2x) had the external cards mounted under /mnt/sdcard/(_)External_SD, or under "mnt/emmc" as is the case under CM#. It might drop down to not having write access to these directories (although that'd be strange and never encountered efore on my devices, at least)...
EDIT: under Opera, for example, I can save an embedded image on XDA on the external microSD and I can find it with Total Commander (and open it with QuickPic).Still, I'm rooted.
Click to expand...
Click to collapse
Thank you for the reply. I haven't rooted yet but plan to do so this weekend. I'll see if that makes any difference.
as for reading from the card, yes, I can confirm that I can do the same - anything I put on the external card, my apps can read from it. I just can't seem to make apps write to that card, only internal.
Thanks!
asoong said:
Thank you for the reply. I haven't rooted yet but plan to do so this weekend. I'll see if that makes any difference.
as for reading from the card, yes, I can confirm that I can do the same - anything I put on the external card, my apps can read from it. I just can't seem to make apps write to that card, only internal.
Thanks!
Click to expand...
Click to collapse
You're welcome. Indeed, I meant that I can save an online image using my browser of choice onto the external memory. That's what seems to be the bottleneck in your case.
MartyHulskemper said:
You're welcome. Indeed, I meant that I can save an online image using my browser of choice onto the external memory. That's what seems to be the bottleneck in your case.
Click to expand...
Click to collapse
Thanks for the explanation. Yes, I can confirm Opera works as advertised. Seems to be the only browser that can.
Stock and FF do not allow custom download directories
Dolphin HD didn't accept paths to external memory (and won't allow downloads larger than 2GB )
Chrome didn't allow downloads at all :crying:
Thanks again!

External SD card access (move apps + apps writing to SD) in Lollipop and Marshmallows

With Lollipop, does the Z5 (without rooting):
allow apps to be moved to an external SD card?
allow apps to write to the external SD card?
With the Z3 and Kitkat, point 2 was possible with root, but I haven't figured out point 1, not even with root.
I read somewhere that Lollipop should allow (2), but it should depend on the implementation of each phone.
Also, do you know if these two points are supposed to change in any way with Marshmallows?
Yes to both. The Z3 does both too.
jeremy_inc said:
Yes to both. The Z3 does both too.
Click to expand...
Click to collapse
Mmm, my Z3 with Kitkat does neither without root. Are you sure the Z5 does?
In my Z3:
There is no 'move app to SD card' option.
As for getting apps to write to the external SD card, I only managed to achieve it with root (there's a way to modify write permission which you can only change if you are rooted). Before this change, for example, Titanium Backup couldn't write backups to the external sd card
Sorry, Z3 on Lollipop I meant
Well apps on SD Works on z5
Just like on z1. I don't know if all apps work this way but:
You have to go to your app menu and check those checkboxes under the SD card page
I believe it'll work the same on z3
For apps to write on SD card it's need to be implemented in the app
For example total commander does this:
Once you try moving to SD card it opens the default android dialog and chose SD card
Bare 2 things in mind:
1. The whole app wont be moved over. Some can still take a load of space up on main storage.
2. When you update an app the system moves the whole app back onto the main storage.
This was from my Xperia z3 experience on lollipop.
Sent from my E5563 using Tapatalk
JKWR said:
Bare 2 things in mind:
1. The whole app wont be moved over. Some can still take a load of space up on main storage.
2. When you update an app the system moves the whole app back onto the main storage.
This was from my Xperia z3 experience on lollipop.
Click to expand...
Click to collapse
Does (2) apply to all apps, or does it depend on how the app was coded by the developers?
I'm thinking of apps where it makes sense to keep the app/engine separate from additional data required (as is the case for games, dictionaries, etc.).
It totally defies the purpose...
To be honest I only remember the biggest culprits which were the big apps, namely:
Ms Word, Excel, PowerPoint. (probably a gb there that you have to mess about with all the time as it seems they are updated at least once a week)
Nearly all Games like plants vs zombies 2, angry birds 2, rayman fiesta run, angry birds transformers, jetpack joyride.
So basically you have to make sure you always have 3-4gig free on your main mem to stop these regular updates from eating every last bit up or getting a long list of update messages saying canot install due to insufficient memory. It drive me nuts on the z3 16gb.
I may have to skip the z5 32gb main mem for this purpose as well. Im a heavy app/game user though so 32gb might be OK for you
Sent from my E5563 using Tapatalk
cdl2 said:
With Lollipop, does the Z5 (without rooting):
allow apps to be moved to an external SD card?
allow apps to write to the external SD card?
With the Z3 and Kitkat, point 2 was possible with root, but I haven't figured out point 1, not even with root.
I read somewhere that Lollipop should allow (2), but it should depend on the implementation of each phone.
Also, do you know if these two points are supposed to change in any way with Marshmallows?
Click to expand...
Click to collapse
1 - Yes - Go to Settings > Apps > Scroll right one to ON SD CARD tab > tick which app(s) you want moving to the SD card. Not everything is moved though, but enough. The Z3 on Lollipop is exactly the same.
2 - Unrooted, the rules are, as far as I can tell - System apps (like File Commander) have full access to the SD card, so can read and write to/from the SD card. If you install a 3rd party app, like another file manager from Play Store, it will not be able to write to the SD card as it is a user app. Certain 3rd party apps can write to the SD card, but their data is stored in a system sub folder on the SD card, and they are restricted to that location only. If you delete the app, the data is also deleted.
I used to use the SD Fix on KitKat, but I just rooted my Z3, and my File Manager can read/write the SD card. Not really sure how we are going to go with rooting Locked Bootloader Z5's yet, so we'll just have to see.
SD card access is changing again in Marshmallow, and should be better, going by what I've heard. You can now choose to treat your SD card as you do now, or as an 'extension' of your internal memory, but I think if you do choose to extend your internal memory, then it will be encrypted for use in that device only. If you don't use it as an extension, then I'm not yet sure what the permissions will be for general read/write access.
MickieH said:
1 - Yes - Go to Settings > Apps > Scroll right one to ON SD CARD tab > tick which app(s) you want moving to the SD card. Not everything is moved though, but enough. The Z3 on Lollipop is exactly the same.
2 - Unrooted, the rules are, as far as I can tell - System apps (like File Commander) have full access to the SD card, so can read and write to/from the SD card. If you install a 3rd party app, like another file manager from Play Store, it will not be able to write to the SD card as it is a user app. Certain 3rd party apps can write to the SD card, but their data is stored in a system sub folder on the SD card, and they are restricted to that location only. If you delete the app, the data is also deleted.
I used to use the SD Fix on KitKat, but I just rooted my Z3, and my File Manager can read/write the SD card. Not really sure how we are going to go with rooting Locked Bootloader Z5's yet, so we'll just have to see.
SD card access is changing again in Marshmallow, and should be better, going by what I've heard. You can now choose to treat your SD card as you do now, or as an 'extension' of your internal memory, but I think if you do choose to extend your internal memory, then it will be encrypted for use in that device only. If you don't use it as an extension, then I'm not yet sure what the permissions will be for general read/write access.
Click to expand...
Click to collapse
Hi, fellows, has anyone solved the problem of writing to external SD cards on marshmallow?

integrating SD card good or bad?

does this feature work better than having the SD card as an external device?
my concern is if you change the card or have to change the card..
surely everything will go to crap if its integrated and you change or upgrade the card.
I won't integrate it, if something goes wrong you have to reformat entire SD card to make it work as normal.
I will just save everything on SD card while internal memory is used for apps/chat storage
The disadvantage is as you have stated. But the advantages are 1) it will become part of your phone storage. You can store app or any other type of date there. 2) It's encrypted and only work while it's in your phone. You won't be able to read it once it's removed but you don't have to worry about loosing sensitive data if someone got your phone. If you need to change the card (replace with a bigger card), just connect to your computer, copy the data to your computer, switch the card, copy date back to new card.
toiday said:
The disadvantage is as you have stated. But the advantages are 1) it will become part of your phone storage. You can store app or any other type of date there. 2) It's encrypted and only work while it's in your phone. You won't be able to read it once it's removed but you don't have to worry about loosing sensitive data if someone got your phone. If you need to change the card (replace with a bigger card), just connect to your computer, copy the data to your computer, switch the card, copy date back to new card.
Click to expand...
Click to collapse
Hi, total n00b here, but is this true? I thought the data stores were completely scattered once an SD card is integrated, so a simple copy of the data (after porting it onto a computer/other storage) to a new SD card would not guarantee reintegration, as you'd have to reintegrate/mount the new SD card.
frankfrank12 said:
Hi, total n00b here, but is this true? I thought the data stores were completely scattered once an SD card is integrated, so a simple copy of the data (after porting it onto a computer/other storage) to a new SD card would not guarantee reintegration, as you'd have to reintegrate/mount the new SD card.
Click to expand...
Click to collapse
When you setup initially, you have option for what folders, app you want to store in the SD card. I choose to keep all the app I use often in the phone (faster) and folders like media (video, pictures, music) in SD since they're the reason I need SD card. I currently have 64GB SD card. I plan to upgrade to 128GB when they have it available in UHS-3. At that time, I'll need to migrate from the 64GB to the 128GB. Here is my plan: Under Settings -> Storage & USB, it shows Phone Storage and SD Card. Under SD Card, it show the Apps folder with my few app in it, my music folder, my picture folder, and my video folder. There, I can move the pictures, Video, music folders to the computer. I then move the app back to phone storage (there is option for that). Then I can eject the SD card. Insert the new one and format as internal storage. Copy the folders back from the computer. In addition, I probably don't need to copy my picture files since they're backed up to Google Pictures.
It's not very convenience but the price I pay for encryption. Don't have to do that often anyway.

Categories

Resources