McDonald's Adopts Kotlin Multi Platform And Jetpack Compose to Streamline Global Mobile App Development

 

Why McDonald's Chose Kotlin Multi-Platform and Jetpack Compose

McDonald's Global Mobile App supports diverse locales, each with unique requirements and configurations. Traditional development approaches often resulted in redundant codebases for Android and iOS, leading to inefficiencies and increased maintenance efforts. McDonald's sought a solution that would allow them to:

  • Reduce Code Redundancy: By sharing business logic across platforms.

  • Improve Performance: By avoiding web-based solutions that compromise user experience.

  • Streamline Development: By enabling native UIs that stay up-to-date with platform standards.

Kotlin Multi Platform allows for the development of shared codebases in Kotlin, which can be used across multiple platforms. Jetpack Compose offers a modern, declarative approach to building native Android UIs, making the development process more intuitive and efficient.

What McDonald's Did

To leverage these technologies effectively, McDonald's engineering team adopted the following approach:

  • Design System Modernization: The team began by developing their design system using Jetpack Compose, enabling a component-by-component replacement of legacy components.

  • Incremental Integration: They integrated Kotlin Multi Platform gradually, allowing new features to be developed and tested in a shared codebase, reducing the need for duplicated efforts across Android and iOS.

Results and Discoveries

The adoption of Kotlin Multi Platform with Jetpack Compose has yielded significant benefits:

Enhanced Developer Productivity:
McDonald's developers found that the declarative nature of Jetpack Compose made it easier to write, read, and maintain code, leading to faster development cycles. The shared codebase in Kotlin Multi Platform reduced redundant work, allowing developers to focus on unique platform-specific features.

Improved Code Maintainability:
Compose's layout system is simpler than the traditional Android Views system, making it easier to organize and manage code. This has resulted in a more maintainable and robust codebase.

Efficient Testing and Experimentation:
The ability to run full end-to-end tests on shared business logic without requiring full application builds has streamlined the testing process. McDonald's has seen faster turnaround times for design changes and new feature implementations, thanks to the real-time previews and intuitive tooling in Android Studio.

Focus on Core Business Logic:
By centralizing business logic in the KMM library, McDonald's can ensure consistency across platforms while minimizing the learning curve for developers. This approach has also simplified the process of handling complex localization and configuration logic for different markets.

Unique Insights and Challenges

Learning Curve for iOS Developers:
While Kotlin shares similarities with Swift, iOS developers initially faced a learning curve when adapting to the KMM environment. However, with training and experience, the transition became smoother.

Library Compatibility:
Not all libraries have Kotlin-based equivalents. McDonald's addressed this by using the expect/actual code paradigm to implement platform-specific code where necessary. Additionally, updating to the latest version of Kotlin helped mitigate issues with asynchronous method calls and coroutine handling.

Network and Storage Solutions:
McDonald's leveraged SQLDelight for multiplatform persistence, ensuring that rule sets and configuration data were efficiently cached on devices, even in environments with unreliable network connectivity.

Recommendations for Prospective Users

For organizations considering Kotlin Multi Platform with Jetpack Compose, McDonald's offers the following recommendations:

1.     Start Small and Scale Gradually:

    • Begin by integrating KMM and Compose into new projects or individual components to minimize risk and allow for a smooth transition.

2.     Invest in Developer Training:

    • Provide comprehensive training to help developers adapt to Kotlin Multi Platform with Jetpack Compose, ensuring they can fully leverage the capabilities of these technologies.

3.     Engage with the Community:

    • Participate in the developer community to share knowledge, troubleshoot issues, and stay updated on best practices.

4.     Focus on Shared Business Logic:

    • Use KMM to centralize business logic, reducing redundancy and ensuring consistency across platforms.

5.     Utilize Modern Tooling:

    • Take advantage of Android Studio’s real-time previews and other tooling to streamline development and testing processes.

Looking Ahead

As Kotlin Multi Platform with Jetpack Compose matures and third-party libraries enhance their capabilities, McDonald's plans to expand its use of KMM, further reducing redundant logic and improving development efficiency. The ability to write and test code once, rather than maintaining separate codebases, will continue to drive innovation and enhance the mobile app experience for their global user base.

By embracing Kotlin Multi Platform with Jetpack Compose, McDonald's has set a new standard for mobile app development, demonstrating how modern technologies can drive efficiency, improve code quality, and enhance developer satisfaction. Their journey offers valuable insights for other organizations looking to modernize their development processes and deliver superior user experiences.

Related Posts

Previous
Previous

Square's Leap into the Future with Kotlin Multi Platform and Jetpack Compose

Next
Next

Netflix Innovates Mobile App Development with Kotlin Multi Platform And Jetpack Compose