So at work, I have been working on codebase which is almost 2 years old. It seems like its written by some students who were just started to learn Android development. Here's some quick facts about codebase:

  • No architecture like MVP, MVVM or anything. Each single Activity class does everything like UI work, data persistence, network calls, deep links integrations, business logic, and so on. This results in classes with 20,000 lines of code and makes code navigation a lot harder.

  • Some Activity classes include code for 3-4 screens. Like layouts have 4-5 sub layouts and those are being shown/hidden according to the state of app. Again, each screens' logic, network calls, persistence etc goes into same activity class.

  • The code is in Java and uses lots of old libraries like Volley etc. I have recently shifted codebase to use AndroidX which itself was a big problem. There's no Material Components or anything close to Material Design. Sometimes it feels like the designer is more familiar with iOS. So design patterns, UI interactions are more like iOS way. So sometimes it becomes hard to create such in Android.

  • The app uses lots of flavors and dimensions to create white labeled app for each client using different server, databases, color schemes, and which features to enable etc.

Now we are scaling to more clients day by day. We want to refactor the codebase to Kotlin and preferably use some architecture atleast a little. We are currently removing network calls from all classes and shifting them to a repository class at start.

How do we proceed with this? We would love to know your feedback.