brian
brian

Reputation: 6922

How to write a file for app but not used by user?

I want to create a file t save some information for my app next time initial use. I want the file is place in program not in sd card. What position of the file I can set?

InputStreamReader fsr = new InputStreamReader(openFileInput(**what position** +"test.xml"));

Upvotes: 0

Views: 75

Answers (2)

Tang Ke
Tang Ke

Reputation: 1508

Context.getDir() also return private directory of your application.

Upvotes: 1

Ted Hopp
Ted Hopp

Reputation: 234867

Use openFileInput()/openFileOutput(), which can be called for any Context (including your Activity).

Upvotes: 1

Related Questions