Comprehensive Android design organization

I am thinking of trying to build a complex structure of Android apps for a game, perhaps or just for practical reasons. Im used for code in objective-c, so I haven't experienced much in android ...

In any case, we create our application on ios as follows:

-core framework: handling all basic elements, navigation, data handling, mechanisms, etc., the same in our entire project

-project framework: its files mostly rely (including) on ​​the main framework files, extending / modifying them and making stuff project specific

-skin framework: this contains all resources and images, if we want to make a project with an updated design we only need to change this

- main project: this includes everything that just bundles everything into an application. just launches the application, nothing else, does something else using various frameworks

So, I wanted to create a similar structure on Android, but I'm not sure if I can even do this ... I see that there is an Android project and libraries project, I can include them in eachother ... but my questions are:

1: is it possible to build a similar structure on ios for example?

2: can I, for example, create a "core" library that contains the framework of the mechanisms, and another library that contains only resources, and a third (or the third could be an actual executable project) that can get resources from the resource library, can distribute jobs in the main library, etc.

3: can I arrange the resources as I see fit (so as not to throw each image into the root of the download folder, for example). For example to have some sort of symbols folder (I know I can't do forlders in the res folder) and also map files to the map folder, etc. My only chance to call them "right"? (map_sheet_type_1, map_sheet_type_2, character_sheet_type_1, etc.) (if it's a game it will use opengl, lots of sprite drawings, etc.)

or should I be doing everything in one project, dividing everything into many packages and using libraries only for tasks such as "how to recode object" A "into" object B "?

Thanks for the answers in advance

+3


source to share


2 answers


although I've never developed a game before, but an app is an app:

  • Yes
  • since you mention that you have executable projects and libraries projects, libraries can use other libraries and the only thing that comes to the device is that the executable project is being built. It is very important to note that compiled *.jar files

    resource libraries cannot be used in your executable project (why ActionBar Sherlock should be used as a project library). To use a resource hosted in a library project, the project must be open source with full source in Eclipse so that it can be compiled together. This is because there is only one R (resources) object inside the application, and at build time, all resources from all projects are pooled.
  • Unfortunately no. As you mentioned, resources cannot be in subfolders and even filenames are limited as they can only use lowercase letters, numbers and _

    (underscore). Just be smart and organized, write a spec or whatever.
  • packages is a way to organize a single Java project. If you are going to use several or one, this is your choice. Usually you can encapsulate in the material of the library-project, which can be easily used in different projects, and the final project will contain everything that is characteristic of this application / game. I'll give you an example at the place where I work, we have KicthenLibrary, which is a library project that we use in every Android app we make. This library already contains excellent multithreaded boot files and cache files, we used to have MapFragments (now deprecated) before Google released their MapFragments, simple Http GET / POST methods, etc. As you can see, these are all things that can be easily used in several different projects.


And as the last trick http://www.eclipse.org/egit/ IMHO it is much easier to use GIT directly from within Eclipse.

+1


source


Here are some links to help you get started.

http://kasperholtze.com/android/how-to-best-organize-your-android-source/

http://bartinger.at/organization-tips-for-android-projects/



Also, when I worked at startup, we created an iOS and Android app. We started creating our own apps for each one and ended up with a slightly different structure. Global info / variables were handled differently and I couldn't structure files like iOS. However, the structure of Android is not very hard to understand and I have made many sub-folders in my assets folder (for libraries and js, etc.). And yes, you can definitely have multiple libraries.

For multiple projects in multiple apps, see this link How to create one app from multiple Android projects

0


source







All Articles