Android Application Development (AND-401) — Question 58
When creating a file using android.content.Context.openFileOutput("test.txt", 0), where is the file created?
Answer options
- A. /data/app/<package name>/files
- B. /data/data/<package name>/files
- C. /system/app/<package name>/files
- D. /system/data/<package name>/files
Correct answer: B
Explanation
The file is created in the directory /data/data/<package name>/files, which is the standard location for application-specific files. Options A, C, and D point to incorrect directories that do not apply to where an app's private files are stored.