-
API 를 통해 FilePath 를 가져올 때 absolute path 정보가 조금 아리까리하다.
그래서 FilePath return 을 정리하여 감을 잡기 쉽게 하기 위해 이 글을 적어본다.
-
아래 path 에 data/user/0 = data/data 이다. (main user 일 경우)
-
https://developer.android.com/reference/android/content/Context.html#getDir(java.lang.String,%20int)
Context.getDir(<directoryName>, MODE_PRIVATE)
/data/user/0/<packageName>/app_<directoryName>
-
https://developer.android.com/reference/android/content/Context.html#getFilesDir()
Context.getFilesDir()
/data/user/0/<packageName>/files
Context.getExternalFilesDir(<directoryName>)
/storage/emulated/0/Android/data/<packageName>/files/<directoryName>
-
Context.getFileStreamPath(“”)
/data/user/0/<packageName>/files
-
https://developer.android.com/reference/android/content/Context.html#getNoBackupFilesDir()
Context.getNoBackupFilesDir()
/data/user/0/<packageName>/no_backup
-
https://developer.android.com/reference/android/content/Context.html#getCacheDir()
Context.getCacheDir()
/data/user/0/<packageName>/cache
https://developer.android.com/reference/android/content/Context.html#getExternalCacheDir()
Context.getExternalCacheDir()
/storage/emulated/0/Android/data/<packageName>/cache
-
https://developer.android.com/reference/android/content/Context.html#getDataDir()
Context.getDataDir()
/data/user/0/<packageName>
-
https://developer.android.com/reference/android/content/Context.html#getObbDir()
( obb 는 opaque binary blob 으로 google 이 android file system 을 위해 개발한 포맷. )
Context.getObbDir()
/storage/emulated/0/Android/obb/<packageName>
-
https://developer.android.com/reference/android/content/Context.html#getCodeCacheDir()
Context.getCodeCacheDir()
/data/user/0/<packageName>/code_cache
-
https://developer.android.com/reference/android/content/Context.html#getExternalMediaDirs()
Context.getExternalMediaDirs()
/storage/emulated/0/Android/media/<packageName>
-
https://developer.android.com/reference/android/os/Environment
Environment.getDataDirectory()
/data
Environment.getDownloadCacheDirectory()
/data/cache
Environment.getExternalStorageDirectory()
/storage/emulated/0
Environment.getExternalStoragePublicDirectory(<directoryName>)
/storage/emulated/0/<directoryName>
Environment.getRootDirectory()
/system
끝
'프로그래밍 놀이터 > 안드로이드, Java' 카테고리의 다른 글
[android] implicit broadcast - signature permission or FLAG_RECEIVVER_INCLUDE_BACKGROUND (0) | 2022.12.30 |
---|---|
[android] StrictMode 에 대해 다시 한번 알아보자 (0) | 2022.12.29 |
[android] ListView, RecyclerView 에서 top position 인지 판단하는 방법 (0) | 2022.12.27 |
[android] AudioFocus 관리하기 (1) | 2022.02.14 |
[kotlin] CoroutineContext 에 대한 이해 (0) | 2022.02.03 |
댓글