A crucial part of the process I use to develop Android apps is code review. It helps me avoid release branch issues, make sure I follow best practices on the app’s architecture and security, improve performance and make overall code maintenance simpler and easier.
With no further ado let’s just go right into the list.
Go through your code’s logic and make sure all conditions are correct and have no mistakes. For Android apps using an MVP design pattern, should be easy to find all the logic within the presenter.
As you already realised from the previous point, you should check your code’s design pattern implementation; it is very important to correctly implement and stick to the design pattern you choose for your Android app.
Null Pointer Exceptions
Scan your code for unsafe/unchecked operations and make sure to fix them. Android Studio has built-in tools to help you with that.
Make sure you reuse your code wherever you can. Identify chunks of code that can be written in a reusable manner and try to shrink your codebase with reusability as much as possible.
It is very important that a team sticks on code standards and best practices, this will help catch bugs early on and increase software quality.
Analytics and Other Trackers
Nowadays it’s very rare to find an app or a company that does not track their user’s actions across their app as well as catching and reporting bugs or such other analytics. Checking for tracking code implementation across your Android app while reviewing a pull request is a great time to do so.
Saving the app state is something we tend to forget implementing. While reviewing a PR it is a great time to verify that you did not forget to save your app’s state.
Activity Lifecycle Mirroring
With the new Android architecture components, we get tools that simplify the management of the app’s lifecycle. Even so, we should always check that we mirror events that are triggered by an activity’s lifecycle.
On your XML code for the layout design, it is important to check that you are not using complex layouts causing excessive rendering and hence decreasing the performance of your app. Instead try to keep your views usage to a minimal.
Dimens, Strings and Constants
Make sure you do not have any of the app Strings, Dimens or Constants hardcode in your app’s code. Instead, move them all in a central file with your well-written documentation making the maintenance easier.
Selectors, On-Boarding and Details
It is important that along with a performant-driven and well-designed app we make sure that our app welcomes and retains our users; making their experience as better as we can, with selectors that assure users of their actions, help users navigate and use the app and other such details.
Last but not least, making sure that all supported languages of our app are clearly translated is key to a great app with international success.
Code review process is a very important task that you should be doing in order to maintain a great app. Making sure to have a written list with the most important points to check when reviewing your code is key and cannot express enough on how highly I recommend doing so.
If you do have your own checklist, or have a checklist for another language you code in, feel free to reach me on social (mentioned below) as I’d love to know what are the points you check.