I have a .vcf file and I want to put it in Android so I can read it from my code. The problem is that I cannot put it into assets folder, because I want to overwrite/edit this file later. How should I do this?

有帮助吗?

解决方案

First since you might want to load it via code, you may need to include the .vcf file in /assets folder just for loading.

Then you can copy the .vcf file to the device's internal or external storage for doing overwrite/edit operation on the fly.

For more information about the internal and external storage, please refer to Android Developers: Storage Options

其他提示

You can save it in the phone's internal memory using FileOutputStream and next edit it using FileOutputStream too. If you only want to read it, you can use FileInputStrem instead.

You can save the file in the assets folder and when you open the app, save it as I have just said.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top