0

When My application is running I want to capture some information and save this to a folder in my application rather than to the device. I have read online that it is not possible to save a file to your assets or res directory. However would it be possible to save it to another file in your application?I had a look at Shared Preferences but that seems to be only for Key Value pairs.

4

3 回答 3

0

http://developer.android.com/guide/topics/data/data-storage.html

使用 MODE_PRIVATE 写入内部存储应该可以处理我认为您想要的内容。

于 2013-03-01T16:44:01.357 回答
0

您不能在运行时将文件存储在 Assets 或 Raw 文件夹中。相反,如果您有图像/视频/音频/文本文件,则可以将文件存储在 SD 卡中,并将这些文件的路径存储在数据库或共享首选项中的文件中。

于 2013-03-01T16:44:02.357 回答
0

安装后,每个应用程序都会在“/data/data/com.your.app.package.name”中创建一个存储。在那个地方保存你想要的任何东西。

于 2013-03-01T16:45:18.687 回答