Preparing for deployment

Before we release your application, it's required to do some preparation work. First of all, remove any unused resources or classes. Then, mute your logging! It's good practice to use some of the mainstream logging library. You can a create a wrapper around the Log class and, for each log output to have a condition, check that it must not be the release build type.

If you haven't yet set your release configuration as debuggable, do so as follows:

    buildTypes { 
      release { 
        debuggable false 
    }     ...

Once you have completed this, check your manifest once again and clean it up. Remove any permission you don't need anymore. In our case, we will remove this:

 <uses-permission android:name="android.permission.VIBRATE" ...

Get Mastering Android Development with Kotlin now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.