I was reading the tutorial on how to get organized, which is very helpful.
http://coronalabs.com/blog/2012/07/10/best-practices-for-organizing-projects/
I just wanted to be extra careful and wanted to make sure that the files can be read properly by corona or certain devices. Is there anything that I have to be careful about?
I read some of the comments, and am curious if they still apply or changed since then. These are the comments:
_ ---- _
An important note if you’re going to be opening files from a directory. For example maybe you’ve got some configuration data in data/config.json. You must use system.pathForFile() when opening the file with io.open(), you cannot just use a relative path like you can with display.newImage(). This is tricky because a relative path passed in will work in the simulator but will *not* work on device.
_ – _
_ One thing which has been mentioned, but which I use a lot, are the use symbolic/hard links to import common code into the project. _
_ You have to be careful, because the compiler doesn’t play nice with softlinked directories in a few cases, but it means that common images and code can be stored in one place rather than duplicated across multiple projects. _
_ ---- _
_ I thought subfolders only would work for iOS not Android. _
_ — _
That’s great. I guess I hadn’t seen any big announcement about it being safe to use subfolders in all cases (as of earlier this year there were still limitations on sound and video files under Android). I poked around on the forums, and it seem like this is now supported on all platforms/devices. So that’s great. I’m going to go start organizing my projects now.
_ I’m still a little annoyed that I have to have 12 icons in the root directory. It would sure be nice if we could get the build tools to look in, oh, I don’t know, an “icons” subfolder _