언어/Android
[Android] 응용프로그램 디렉터리 검색
정현석
2010. 2. 18. 14:56
안드로이드 응용프로그램 자료는 안드로이드 파일 시스템의 아래와 같이 디렉터리에 저장된다.
/data/data/<응용프로그램 패키지 이름>/
이 디렉터리 안에 DB, 선호설정, 원본 파일들을 위한 하위 디렉터리들이 필요에 따라 생성된다. 코드에서 파일을 다루려면 우선 Application의 Context 객체를 얻어야 한다.
android.content.Context
Return a new Context object for the given application name.
|
Returns an array of strings naming the private databases associated with this Context's application package.
| |
Delete an existing private SQLiteDatabase associated with this Context's application package.
| |
Delete the given private file associated with this Context's application package.
|
Returns an array of strings naming the private files associated with this Context's application package.
| |
Return the context of the single, global Application object of the current process.
| |
Return the full application info for this context's package.
|
Returns the absolute path to the application specific cache directory on the filesystem.
|
Returns the absolute path on the filesystem where a database created with
openOrCreateDatabase(String, int, SQLiteDatabase.CursorFactory) is stored. | |
Retrieve, creating if needed, a new directory in which the application can place its own custom data files.
| |
Returns the absolute path on the filesystem where a file created with
openFileOutput(String, int) is stored. | |
Returns the absolute path to the directory on the filesystem where files created with
openFileOutput(String, int) are stored. |
Return a localized, styled CharSequence from the application's package's default string table.
|
Open a private file associated with this Context's application package for reading.
| |
Open a private file associated with this Context's application package for writing.
| |
Open a new private SQLiteDatabase associated with this Context's application package.
|
int | MODE_APPEND | File creation mode: for use with openFileOutput(String, int) , if the file already exists then write data to the end of the existing file instead of erasing it. |
int | MODE_PRIVATE | File creation mode: the default mode, where the created file can only be accessed by the calling application (or all applications sharing the same user ID). |
int | MODE_WORLD_READABLE | File creation mode: allow all other applications to have read access to the created file. |
int | MODE_WORLD_WRITEABLE | File creation mode: allow all other applications to have write access to the created file. |