I did some searching but came up dry... where is the appropriate location to store my shader files? Assets, the raw folder of resources, or somewhere else entirely?
Thank you
I did some searching but came up dry... where is the appropriate location to store my shader files? Assets, the raw folder of resources, or somewhere else entirely?
Thank you
I've used both methods in the past, and both work fine.
One thing to consider is if you are going to use this code in a Library Project at any point in time. If you are, I would recommend using the res/raw directory, as assets has limitations with Library Projects.
From the documentation:
Library projects cannot include raw assets
The tools do not support the use of raw asset files (saved in the assets/ directory) in a library project. Any asset resources used by an application must be stored in the assets/ directory of the application project itself. However, resource files saved in the res/ directory are supported.
Honestly, I would do neither. Storing them in your code itself is probably the safest and most secure method of doing it. (Making them public static final String
variables in some class, that is.) I'd probably build them using StringBuilder
when the app starts or when the class is initialized.
If you feel more comfortable with storing the files themselves, use assets
. Using res/raw
has restrictions on filenames, and you cannot use subdirectories in raw
.