UPDATE: Google's API changes to KitKat means the following, as per Google:
An application may request broad read-oonly permissions for external storage. This means that the application will be able to read the MicroSD only.
Applications cannot obtain permission to write to external storage. This means that file managers cannot edit/create/delete files on MicroSD anymore. This is a casualty of a change meant for security.
With or without requested permission for external storage, an application may now modify conents of its assigned folder on external storage (IE, /android/data). This allows an application to offload content to external storage if the storage is considered "permanent," Ie, MicroSD is considered permanent while OTG is not.
The benefits to this change means that applications required less tweaking to offload their data to external storage. We saw this with the recent Google Music update (and I'm loving that). Even now, it seems updates to recent Google applications are preparing to utilize this functionality. Google's camera.apk has taken up residence on my MicroSD so I suspect that a future update will allow you to store to external storage.
The downsides are that file managers cannot make use of MicroSD anymore, aside from reading the contents. Consider it collateral damage.
-reserved-
Titanium backup. Requires external SD permissions.xml fix to be able to store there.
Sent from my GT-I9505G using Tapatalk
ES doesn't work. If you delete a folder, it will show as deleted. Exit and come back, and the folder remains. Cannot edit or create a folder (in MicroSD).
Bump. OP now has full explanation of what's going on.
jaykresge said:
UPDATE: Google's API changes to KitKat means the following, as per Google:
An application may request broad read-oonly permissions for external storage. This means that the application will be able to read the MicroSD only.
Applications cannot obtain permission to write to external storage. This means that file managers cannot edit/create/delete files on MicroSD anymore. This is a casualty of a change meant for security.
With or without requested permission for external storage, an application may now modify conents of its assigned folder on external storage (IE, /android/data). This allows an application to offload content to external storage if the storage is considered "permanent," Ie, MicroSD is considered permanent while OTG is not.
The benefits to this change means that applications required less tweaking to offload their data to external storage. We saw this with the recent Google Music update (and I'm loving that). Even now, it seems updates to recent Google applications are preparing to utilize this functionality. Google's camera.apk has taken up residence on my MicroSD so I suspect that a future update will allow you to store to external storage.
The downsides are that file managers cannot make use of MicroSD anymore, aside from reading the contents. Consider it collateral damage.
Click to expand...
Click to collapse
Reading from Android Developer new API changes tha way you read and write from External Sd card... but if your app has WRITE_EXTERNAL_STORAGE permission it should be able to write your ext sd card without problems.
This means that current apps (and File Managers) should be updated to support kitkat API level 9 and obtain WRITE_EXTERNAL_STORAGE permission.
public static final String WRITE_EXTERNAL_STORAGE
Added in API level 4
Allows an application to write to external storage.
Note: If both your minSdkVersion and targetSdkVersion values are set to 3 or lower, the system implicitly grants your app this permission. If you don't need this permission, be sure your targetSdkVersion is 4 or higher.
Starting in API level 19, this permission is not required to read/write files in your application-specific directories returned by getExternalFilesDir(String) and getExternalCacheDir().
Constant Value: "android.permission.WRITE_EXTERNAL_STORAGE"
API level 19 is kitkat code....
Related
Regarding 4.4 Kitkat External SD Card access permision, anyone can explain to us what is the objective of having such rigid permissions ?
"....
Starting in Android 4.4, the owner, group and modes of files on external storage devices are now synthesized based on directory structure. This enables apps to manage their package-specific directories on external storage without requiring they hold the broad WRITE_EXTERNAL_STORAGE permission. For example, the app with package name com.example.foo can now freely access Android/data/com.example.foo/ on external storage devices with no permissions. These synthesized permissions are accomplished by wrapping raw storage devices in a FUSE daemon.
..."
Full source : http://source.android.com/devices/tech/storage/
On 4.3 and older, a malicious app can wipe the whole sdcard with standard permissions. New permissions prevent it.
aydc said:
On 4.3 and older, a malicious app can wipe the whole sdcard with standard permissions. New permissions prevent it.
Click to expand...
Click to collapse
So this is useful then not a considered 'bug'..
I guess there will be no benefits anymore to use 3rd party file manager if we dont root our phones. Niche market just collapsed.
Sorry, but I have follow up questions:
I wonder how many malicious pieces of software like that are in a Google Play store to warrant breaking most third party applications that write to SD card? But I guess now, that apps can't write to SD card, there will be not much to protect there anyhow? And how will this all work in the future, once apps get their permissions fixed? I won't be allowed to access my card or format it at will? or will I be able to grant those permissions, but then how would I know the software is malicious any more than I know now? Am I too stupid to grasp the logic of all this?
pete4k said:
Sorry, but I have follow up questions:
I wonder how many malicious pieces of software like that are in a Google Play store to warrant breaking most third party applications that write to SD card? But I guess now, that apps can't write to SD card, there will be not much to protect there anyhow? And how will this all work in the future, once apps get their permissions fixed? I won't be allowed to access my card or format it at will? or will I be able to grant those permissions, but then how would I know the software is malicious any more than I know now? Am I too stupid to grasp the logic of all this?
Click to expand...
Click to collapse
That's what I had in mind too but if you see from the source link above I think Google is anticipating MULTI USER environment where some "stuffs" from me could wrack havoc some of "your stuffs". That scenario actually will only happen on MULTI USER tablet / smartphone, but that surely not mainstream are they ?
pete4k said:
Sorry, but I have follow up questions:
I wonder how many malicious pieces of software like that are in a Google Play store to warrant breaking most third party applications that write to SD card? But I guess now, that apps can't write to SD card, there will be not much to protect there anyhow? And how will this all work in the future, once apps get their permissions fixed? I won't be allowed to access my card or format it at will? or will I be able to grant those permissions, but then how would I know the software is malicious any more than I know now? Am I too stupid to grasp the logic of all this?
Click to expand...
Click to collapse
As stated on source.android.com:
Starting in Android 4.4, the owner, group and modes of files on external storage devices are now synthesized based on directory structure. This enables apps to manage their package-specific directories on external storage without requiring they hold the broad WRITE_EXTERNAL_STORAGE permission. For example, the app with package name com.example.foo can now freely access Android/data/com.example.foo/ on external storage devices with no permissions. These synthesized permissions are accomplished by wrapping raw storage devices in a FUSE daemon.
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.
On Android 7.0, all apps have access to /sdcard/Android/*
For apps to get sdcard access outside that Android folder, they need explicit permission.
I would like to remove the default allowed access to /sdcard/Android/* but keep the system in place that grants root SD access to allowed apps.
Bonus points, if I can somehow rid of DCIM, LOST.DIR, System Volume Information, and .android_secure from being created aswell.
The clutter is getting ridiculous. Simply swapping in an sdcard or plugging in a USB OTG drive will cause it to immedietly get cluttered.
This is external, swappable, storage we are dealing with FFS! Whose bright idea was this damn system.
I have root. (Is Xposed Privacy my only option?)
No I do not have adaptable storage enabled. This is simply regular external storage.
Not sure if many of you are aware, but the U11 allows you to encrypt portable microSD cards in the settings, which is nice for privacy purposes. The problem is since I did that (I even rebooted after) many of my apps can't properly read or write to the microSD card. I've noticed many of said apps don't implement Google's expandable storage permissions properly either (i.e. they don't ask you to select the root directory of the microSD card in Android File Explorer so they have proper read-write access to everything.)
My questions, therefore, are:
What am I doing wrong? Is there some permission I'm missing?
Are 3rd party apps supposed to be able to work with encrypted portable storage?
Is encrypted portable storage even an AOSP feature? Or something specific to 3rd party OEMs?
Why do so many apps not implement microSD storage read/write permissions correctly?
Any ideas?
Hi, I have an old Redmi6A phone (Lineage OS 17.1) that only has 8GB of internal memory. This is very little if you use Whatsapp. Of course I added a 32Gb SD card, but with whatsapp I have trouble saving my photos on the card. What are the possible workarounds?
1- Is there a difference depending on whether you set the SD card as portable storage or internal storage?
2 - My phone is rooted. I've looked for practical solutions including magisk, but no module matches.
3 - Beyond whatsapp, what should I do: is there an app that allows other apps to be installed on the external media? Is this a good idea? Is it better to limit the storage of data on the SD card to avoid the crash of these "deported" apps?
Just an advice or two would make me happy...
If Android device allows to make external SD-card part of internal storage memory ( keyword: Adoptable Storage ) then you are good. Check it.
I believe that my android device allows me to do this. The French translation does not use the words adoptable storage "stockage adoptable" but the 1st drawing seems to match.
What I have read on the subject indicates that the reading and access time to the data on the external card is much longer than on the internal memory. How does android arbitrate what it stores on the internal or external memory? Can the user control this?
I assume and hope that the most crucial apps are on the internal memory
It's on you how much of the SD-card's storage memory ( in % ) you'll add to internal memory: 1,2,...,100.
Yes, reading / writing to device's "portable memory" basically takes longer. So with regards to file transfer speeds, choosing the right memory card is crucial. Look here:
The best SD cards for 2023: top memory cards for your camera
We've tested and ranked all of the best SD cards you can buy
www.techradar.com
Android by default uses device's internal memory. The least app's allow to store their data on external SD-card: this is set by app's developer.
I tested the 2 options; first the adoptable storage but for some reason it didn't work; I mean the operation was correctly done but the 32Gb was not added to my internal memory; just a few hundred Mb more. I repeated the operation 3 times to rule out the possibility of an isolated incident.
So I was forced to reformat the SD card as external memory. Everything went well. But now I'm back to the original situation.
My search led me to 2 apps (Link2SD and App2SD) to override the restriction to move to the SD card. Those apps don't seem to be really used anymore: their peak corresponds to the 2015-2016 versions of Android (Marschmallow and Nougat) and are quite complex to handle since you have to format the external SD card in several partitions to be able to consider moving anything.
What do you think about this type of solution?
As @xXx yYy already said:
The least app's allow to store their data on external SD-card: this is set by app's developer.
Click to expand...
Click to collapse
Thus forget the named 3rd-party-tools that claim they can.
BTW: look inside here
Whatsapp folder in Android: Here's where to find it
WhatsApp folder with all media files in Android can be found on new location if you are on Android 11. Learn here where to find it.
mobileinternist.com
Napafroi said:
I tested the 2 options; first the adoptable storage but for some reason it didn't work; I mean the operation was correctly done but the 32Gb was not added to my internal memory; just a few hundred Mb more. I repeated the operation 3 times to rule out the possibility of an isolated incident.
So I was forced to reformat the SD card as external memory. Everything went well. But now I'm back to the original situation
Click to expand...
Click to collapse
After an external memory got converted to portable memory it's Android what automatically moves data from internal memory to portable memory as long as they moveable to gain internal memory space. Thus the few 100MB you reported.
You always can configure the amount of portable memory indeed to be used by Android's Storage Manager ( SM ) using ADB.
Well, I think I'm getting used to this adoptable storage which is really confusing since the size doesn't take into account the extra 32Gb (in the storage manager and also in solid explorer).
I don't know if it's a bug but sd maid and its memory analysis function allows me to check that telegram, osmand (including downloadable maps) and vivaldi browser will install directly on the adaptable storage. That's all I ask.
It's still surprising not to be able to view the content of the SD card; maybe it's a bug like others have experienced like on this thread
I wanted to experiment a nandroid backup on MicroSD adopted-storage with TWRP which was refused.
xXx yYy said:
You always can configure the amount of portable memory indeed to be used by Android's Storage Manager ( SM ) using ADB.
Click to expand...
Click to collapse
So I understand better the interest to calibrate the portion of adoptable storage...
Screenshot no. 5 shows 2.7 GB of the portable memory ( real capacity 31 GB ) are used.
To get the whole portable memory as internal memory used using ADB try this
Code:
adb shell
sm list-disks -> This cmd returns id of SD-card e.g. 179:160
sm partition disk:179:160 private -> Here you use the id of SD-card
where the numbers are the Android's name of your disk.
I just did this.
Reboot but it didn't change anything. Maybe the card is defective...
EDIT : oh wait, yesterday I inserted this same micro SDcard in an old samsung galaxy tab4 with the "same" custom rom (LineageOS 17.10) as adoptable storage. The 32Gb capacity was not added to internal memory as well. Maybe this rom is buggy for managing adoptable storage.
Sorry for my english
The ( meanwhile outdated ) Lineage OS 17.1 - a Lineage OS 17.10 probably doesn't exist - is based on Android 10 and can "Adoptable Storage" as you initially confirmed.
IMO you are probably doing things wrong
"migrate data" is the 2nd necessary step after 1st step "adoptable-storage" is created. It will ( try to ) move all apps from phone into SD-card ( if app is moveable ), means all new installed apps will directly get installed into SD-card as long as android:installLocation="auto" is defined in app's AndroidManifest.xml.
When 100% disk space got adopted you can't see your SD-card any longer, the only way to check disk usage is from Android's cmd line running df -h /mnt/expand/* ( if Android is rooted consider 3rd party apps like Link2SD instead ).