How to add txt file to your android project?

I have version 1.5.1 of android studio. Apparently, in this version there is never a resource folder for txt files. How do you intend to include these files in your project? And how to continue to use the application inside you? thank you for your advice

+6
source share
2 answers

Project window , press Alt-Insert and select Folder->Assets folder . Android Studio will add it automatically to the right place.

And then you can add your assets or / txt files (no matter what you want) to it.

+5
source

You can go to the New-> add folder → assets folder, and the folder will be automatically placed in the right place.
Please refer to the following where I received this answer - it also includes a screenshot: Adding a data folder in Android Studio

To access anything from the resource folder in the application, you need to use AssetManager:

For a complete example, refer to the following:

How to access the file in the resource folder?

+1
source

All Articles