Lesson Plan: Unit - 05
Subject: P15A2AAD - Android Application Development
Topic of Study: Working with Files and Directories
Grade/Level: Master of Computer Applications
Objective: To understand the mechanism of Files and Directories
Time Allotment: 55 Minutes
Subject: P15A2AAD - Android Application Development
Topic of Study: Working with Files and Directories
Grade/Level: Master of Computer Applications
Objective: To understand the mechanism of Files and Directories
Time Allotment: 55 Minutes
- Working with Files and Directories
- Android application files are stored in a standard directory hierarchy on the Android file system.
- File operators all begin by interacting with the application Context object.
- You can browse an application’s directory structure using the DDMS File Explorer.
- Android application data is stored on the Android file system in the following top-level directory:
- Exa. /data/data/
- Important Methods:
- Exa.
- Creating and Writing to Files to the Default Application Directory:
- openFileOutput() method to create files in the default location under the application data directory: /data/data/
/files/ - For example.
- The following code snippet creates and opens a file called Filename.txt.
- We write a single line of text to the file and then close the file.
- Exa.
- Write a File:
- Exa.
- Append in File:
- Exa.
- Reading from Files in the Default Application Directory:
- Exa.