Exporting the RenderBox package
Now that we've finished creating this beautiful RenderBox
library, how do we reuse it in other projects? This is where
modules and .aar
files come into play. There are a number of ways to share code between Android projects. The most obvious way is to literally copy pieces of code into the next project as you see fit. While this is perfectly acceptable in certain situations, and in fact should be part of your normal process, it can become quite tedious. What if we have a bunch of files that reference each other and depend on a certain file hierarchy, such as RenderBox
? If you're familiar with Java development, you might say, "Well, obviously just export the compiled classes in a .jar
file." You would be right, except that this is Android. We have some generated classes as well as the /res
folder, which contains, in this case, our shader code. What we actually want is an .aar
file. Android programmers might be familiar with .aidl
files, which are used for...