Android 저장 파일 경로 요약

1. Android의 저장소는 개인 저장소와 공유 저장소의 두 가지 범주로 나눌 수 있습니다.

  • Private Storage : 각 애플리케이션은 내부 저장소에 자신만의 전용 디렉터리(/data/data/packageName)를 갖고 있으며, 다른 애플리케이션은 이를 볼 수 없으며, 서로 이 디렉터리에 접근할 수 없습니다.
  • 공유 저장소 : 개인 저장소를 제외하고 미디어 컬렉션, SD 카드 외부 애플리케이션 저장소 디렉토리 등 다른 모든 것은 공유 저장소로 간주됩니다.

2. 안드로이드 시스템 저장 파일 경로

1. 내부 저장 경로

Context.getFilesDir().getPath()

/data/user/0/com.test.myapplication/files
Context.getCacheDir().getPath()

/data/user/0/com.test.myapplication/cache
Context.getCodeCacheDir().getPath()

/data/user/0/com.topqizhi.qwatch/code_cache
Context.getDataDir().getPath()

/data/user/0/com.topqizhi.qwatch

2. 외부 저장 경로

Context.getExternalCacheDir().getPath()

/storage/emulated/0/Android/data/com.test.myapplication/cache
Context.getObbDir().getPath()

/storage/emulated/0/Android/obb/com.test.myapplication
Environment.getExternalStorageDirectory().getPath()

/storage/emulated/0

추천

출처blog.csdn.net/Billy_Zuo/article/details/132852905