구글 문서를 보니
Accessing files on external storage
If you're using API Level 8 or greater, use getExternalFilesDir()
to open a File
that represents the external storage directory where you should save your files. This method takes a type
parameter that specifies the type of subdirectory you want, such as DIRECTORY_MUSIC
and DIRECTORY_RINGTONES
(pass null
to receive the root of your application's file directory). This method will create the appropriate directory if necessary. By specifying the type of directory, you ensure that the Android's media scanner will properly categorize your files in the system (for example, ringtones are identified as ringtones and not music). If the user uninstalls your application, this directory and all its contents will be deleted.
If you're using API Level 7 or lower, use getExternalStorageDirectory()
, to open a File
representing the root of the external storage. You should then write your data in the following directory:
/Android/data/<package_name>/files/
The <package_name>
is your Java-style package name, such as "com.example.android.app
". If the user's device is running API Level 8 or greater and they uninstall your application, this directory and all its contents will be deleted.
이렇게 나와있는데 제가 API 레벨을 8부터 17까지 지정해놓고 개발을 합니다.
근데 문서상에 레벨7 이하는 getExternalStorageDirectory() 이걸 쓰라는데 저는 그냥 이거 쓰고 있거든요. 근데 테스트해보면 8이상 레벨에서 다 잘됩니다.
문서에 따르면 8이상은 getExternalFilesDir() 이걸 쓰라는데 별 차이가 없는 건가요?