Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I add a sub folder to the raw folder in my Android app? [duplicate]

Of course I can right click the raw folder and add new folder but when I export the project, the APK file does not contain the new sub folder.

like image 785
user2187934 Avatar asked Mar 19 '13 18:03

user2187934


People also ask

Can the Android layout folder contain subfolders?

You can organize your resources XML files (layout, drawable,..) into separate subfolders corresponding to the app's features.

What is a sub folder within a folder?

A subfolder is a folder stored inside another folder. Subfolders help you organize your files more completely. Each subfolder should be used to store files related to each other. For example, you might have one folder for files related to a job search.


1 Answers

You can't.

The folders in /res/ have a predefined structure, and you can't add subfolders.

However, seeing as this is the raw folder, you may want to look into using the assets folder, in which sub folders are supported.

Keep in mind thought that by using assets you won't be able to use R.*.* references anymore. You will have to go through the AssetManager.

like image 80
Raghav Sood Avatar answered Sep 27 '22 20:09

Raghav Sood