Android:存储图像的默认位置是什么?

标签 android storage

我正在编写一个从数码相机下载照片的应用程序。将它们保存到什么地方最合适?必须是外部存储,因为预计会有千兆字节的图像。

最佳答案

保存应该共享的文件

如果您想保存不特定于您的应用程序并且在卸载应用程序时不应删除的文件,请将它们保存到外部存储的公共(public)目录之一。这些目录位于外部存储的根目录,例如 Music/、Pictures/、Ringtones/等。

In API Level 8 or greater, use getExternalStoragePublicDirectory(), passing it the type of public directory you want, such as DIRECTORY_MUSIC, DIRECTORY_PICTURES, DIRECTORY_RINGTONES, or others. This method will create the appropriate directory if necessary. If you're using API Level 7 or lower, use getExternalStorageDirectory() to open a File that represents the root of the external storage, then save your shared files in one of the following directories:

Music/ - Media scanner classifies all media found here as user music.
Podcasts/ - Media scanner classifies all media found here as a podcast.
Ringtones/ - Media scanner classifies all media found here as a ringtone.
Alarms/ - Media scanner classifies all media found here as an alarm sound.
Notifications/ - Media scanner classifies all media found here as a notification sound.
Pictures/ - All photos (excluding those taken with the camera).
Movies/ - All movies (excluding those taken with the camcorder).
Download/ - Miscellaneous downloads.

filesExternal

关于Android:存储图像的默认位置是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8268186/

相关文章:

Android:如何检查 Checked ListView 中的特定项目?

android - 为 Android 编写 SDK 的具体规则

android - Flutter 在下载文件夹中创建文件

android - native 调用会阻塞主线程

java - 在代码中进行更改后,模拟器未显示更新的输出

android - Cordova - 将文件保存到存储

ssh - 如何通过 ssh 连接到 Google 计算引擎磁盘?

azure - 最大限度降低 Azure 存储出站数据成本的策略

swift - Firebase 存储上传错误 : FIRStorageErrorDomain Code=-13000

android - FragmentPagerAdapter 无法解析为类型