Are user-defined directory names allowed in an Android Eclipse project
-
11-12-2019 - |
Question
I think I may know the answer to this question already, but I just wanna be 100% sure. Anyways, I am writing an Android app using Eclipse 4.2 ("Juno"). I want to create my SQLite database by using external files and reading/parsing these files by my code. Hence, I created my own directory called /database
and placed it in my project's root directory. Then, Eclipse starts complaining, reports a problem and says:
Invalid recourse directory name.
I even tried placing my database
directory in the existing /res
directory, but that caused the same Eclipse problem. Just want to confirm what my initial thoughts are: Is it not allowed for me to define my own directories in the project and bundle it in with my release?
If so, then I guess I'll have to follow along with what was posted in this stackoverflow question.
Solution
put it in /assets not in /res and it should work.
OTHER TIPS
You should be able to create arbitrary directories in the root of your Android project, however your application won't be able to access these files. This is useful for development purposes like storing test data, documentation, or jar files. However, you cannot create non-standard directories in places like gen
and res
.