Optimizing an Android package
Google has well-defined a set of steps during the packaging and releasing phases of an Android application to ensure authenticity, optimization, and security. There are three suggested practices: sign, obfuscate, and zipalign. The first one is always performed automatically by the Android build system, even if we don't explicitly describe it in Maven configuration and specify a custom key. The other two are optional, but highly recommended for all Android developers.
In this section of the chapter, we will briefly explain the purpose of each step, and then we will discuss how we can configure Maven to run these tasks in a well-structured way like we have already done in all previous examples.
Signing an application
Like we said, Android requires that all packages, in order to be valid for installation in devices, need to be digitally signed with a certificate. This certificate is used by the Android ecosystem to validate the author of the application. Thankfully...