Can someone explain in detail about the various storage locations in Android,
Really confused with these? And are there any methods to access them programatically whenever needed?
On your phone, you can usually find your files in the Files app . If you can't find the Files app, your device manufacturer might have a different app.
I can't speak for storage paths on all phones. But I can explain you clearly with respect to my phone; Coolpad Note 3 - running on Android 5.1. Because, the storage locations or paths may vary on other mobile phones depending on your vendor/manufacturer and different versions of Android OS.
Generally, /someDirectory
or /root/someDirectory
or >root>someDirectory
are same. Which among them is picked to display; depends on your file manager.
On my phone:
/root/sdcard
is storage path to phone's internal memory(16 GB in my case).
Both /storage/emulated/0/
and /storage/sdcard0/
are symlinks to /root/sdcard
. It means, these two paths are also storage paths of my phone's internal memory.
/storage/sdcard1/
is storage path of my micro SD card.
On ANY phone:
Before Android 4.2, only one user could user your phone. There was no concept of two or more users creating separate profiles and logging into the same phone.
As a result, there were no such paths like /storage/emulated/someDirectory
The emulated directories came up after the introduction of multiuser API in Android 4.2.
Source: source 1 and source 2
So from then,
/storage/emulated/legacy/
points to External Storage(Android terminology) of the currently working user. It would be a symlink.
/storage/emulated/anyNumber/
points to External Storage(Android terminology) of a specific user.
On my phone: I have two users.
internal memory location for user1 (Ramesh) is: /storage/emulated/0/
internal memory location for user2 (Kishore) is: /storage/emulated/10/
So /storage/emulated/legacy/
would point to /storage/emulated/0/
if user1(Ramesh) logs in & uses the phone. In this case, /storage/emulated/legacy/
would be a symlink to /storage/emulated/0/
And /storage/emulated/legacy/
would point to /storage/emulated/10/
if user2(Kishore) logs in & uses the phone. In this case, /storage/emulated/legacy/
would be a symlink to /storage/emulated/10/
If you want to know more about storage paths, please go through this answer on android.stackexchange.com
I specifically mentioned External Storage(Android terminology) above. Because, the Internal and External Storage terminology according to Google/official Android documentation is quite different to that of normal Android OS user.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With