简体   繁体   中英

Saving a file to your own android application

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.

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

Writing to internal storage with MODE_PRIVATE should handle what I think you want..

You cannot store the files in the Assets or the Raw folder at run time. Instead if you have image/video/audio/textual files you can store the files in your SD card and store the path of those files in your file in Database or shared preferences.

After installation each application creates a storage located in '/data/data/com.your.app.package.name'. Save whatever you want in that place.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM