Android Image Store

时间:2010-12-27 15:26:33

标签: android

  

可能重复:
  How to capture an image and store it with the native Android Camera

如何将拍摄的图像从相机存储到DCIM / Camera文件夹中...默认情况下

1 个答案:

答案 0 :(得分:1)

您需要进入DCIM文件夹吗?我认为首选文件夹是图片。在这里,您可以找到有关如何使用共享文件夹的说明的链接: http://developer.android.com/guide/topics/data/data-storage.html

保存应共享的文件

如果要保存不是特定于应用程序的文件,并且在卸载应用程序时不应删除这些文件,请将它们保存到外部存储器上的某个公共目录中。这些目录位于外部存储的根目录,例如Music /,Pictures /,Ringtones /等。

在API级别8或更高级别中,使用getExternalStoragePublicDirectory(),向其传递所需的公共目录类型,例如DIRECTORY_MUSIC,DIRECTORY_PICTURES,DIRECTORY_RINGTONES或其他。如有必要,此方法将创建适当的目录。

如果您使用的是API级别7或更低级别,请使用getExternalStorageDirectory()打开代表外部存储根目录的文件,然后将共享文件保存在以下目录之一中:

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.