Environment.getExternalStorageDirectory() gets the internal storage card or the external storage card?

Recently, when looking at the category of writing APP records to the memory card, I suddenly found that the path for writing logs is:

            Environment.getExternalStorageDirectory()+“app_log/log.txt”

But when viewing on the phone, the log file is found in the internal storage of the phone:


It feels bad for a moment, isn't it a good external storage? Isn't it getExternalStorageDirectory()?


Saw in a blog:

All Android devices have external storage and internal storage. These two names are derived from early Android devices. At that time, the internal storage of the device was indeed fixed, and the external storage was indeed removable like a USB flash drive. However, in later devices, many mid-to-high-end machines expanded their body storage to more than 8G. They conceptually divided the storage into two parts, "internal" and "external", but in fact they are all inside the phone. So no matter whether Android phones have removable sdcards, they always have external storage and internal storage. The most important thing is that we all access the removable sdcard or the storage (external storage) that comes with the phone through the same api

Although external storage is a bit complicated in concept, it is also easy to distinguish. When you connect your phone to a computer, the part that can be recognized by the computer must be external storage.

That's it.





Guess you like

Origin blog.csdn.net/u011288271/article/details/80539456