Android path not getting
When I am dealing with an iPhone application, I know where the sandbox of the application is stored and when I save something I can easily access the document directory of my application.
But, in android, I don't know what is the similar thing to it, so can anybody let开发者_如何学运维 me know where this file will be stored and how can I can get the access to it?
it'll be stored in your workspace under the folder with projects name
You can read some general information about resources in android here: http://developer.android.com/guide/topics/resources/index.html
To access internal storage of the deviace:
For reading:
InputStream is = getContext().openFileInput(filename);
For saving:
FileOutputStream fos = getContext().openFileOutput(filename, Context.MODE_PRIVATE);
ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(fos));
out.writeObject(survey);
out.close();
If you use eclipse you can browse files using DDMS perspective (Window->OpenPerspective->Other->DDMS).
精彩评论