I have some “data/helper classes” defined which I use in several projects. These data classes are quite big and really do not change between the projects. There is some logic in the data classes in their methods – this also remains the same among all the projects. These “data classes” are not activities!
Now when creating a new project that uses these “data classes” it needs to compile all their code everytime, since I always make a copy of these classes and paste it in the new projects. This slows down the development/compilation of new projects.
Is there an efficient way to “pre-compile” or somehow define these “data/helper classes” as library components so that development of new projects is more efficient and only compiles the new code just linking in these “data classes” somehow?
I only found a way to make activities into libraries – but this reusable classes are not activities.
Many thanks!
This is a very common use case, You should move and create all your common stuff (data/helper classes) into a classic jar library, compiled and end up with a common-lib.jar, and add this common-lib.jar to either your main project or library project classpath.
Check out the official dev guide here to see how to add external jar library to either Android project or Android library project.