最終更新:2019-01-23 (水) 12:11:06 (1882d)
Context.getExternalFilesDir
Top / Context.getExternalFilesDir
外部ストレージ上のプライベート ストレージ ディレクトリを取得
概要
- Returns the absolute path to the directory on the primary shared/external storage device where the application can place persistent files it owns.
- These files are internal to the applications, and not typically visible to the user as media.
メモ
- 内部メモリを外部ストレージとして使用するためにパーティションを割り当てている端末では、SDカード スロットも使用できる場合があります。
- このような端末がAndroid 4.3以下を実行している場合、Context.getExternalFilesDir() メソッドを使用すると、内部パーティションへのアクセス権のみが付与され、アプリは SDカードを読み書きできません。
- しかしAndroid 4.4以降では、Context.getExternalFilesDirs?() を呼び出すと、各場所のエントリを示すjava.io.File配列が返され、どちらの場所にもアクセスできます。
type
- If you supply a non-null type to this function, the returned file will be a path to a sub-directory of the given type.
- Environment.DIRECTORY_MUSIC?
- Environment.DIRECTORY_PODCASTS?
- Environment.DIRECTORY_RINGTONES?
- Environment.DIRECTORY_ALARMS?
- Environment.DIRECTORY_NOTIFICATIONS?
- Environment.DIRECTORY_PICTURES
- Environment.DIRECTORY_MOVIES?
Unity
関連
- Context.getExternalFilesDirs? - Android 4.4〜