Skip to content Skip to sidebar Skip to footer

Save A (.txt) File To The Assets Folder In Android?

How to write to .txt file in assets folder. How to get path assets folder ?

Solution 1:

The path of assets folder is file:///android_asset But this is read-only.

The assets folder is like folders res, src, gen, etc. These are all useful to provide different files as input to build system to generate APK file for your app.

All these are read-only while your app is running. At run-time you can only write to SD card.

I hope you understand my answer.

Solution 2:

Solution 3:

No you can't do this, because of if you read and write both at runtime then everything could be change and application will behave unexpected which could be harmful or may be crashed. i suggest you to use internal memory, sqlite and app SharedPreferences etc.

Post a Comment for "Save A (.txt) File To The Assets Folder In Android?"