HubLensTrendingmeituan/WMRouter
// archived 2026-05-02
meituan

WMRouter

Mobile#Android#Router#Componentization#Java#Kotlin
View on GitHub
2,364

// summary

WMRouter is an Android routing framework based on component-based design principles, featuring flexibility and ease of use. The framework primarily provides two core functions: URI distribution and ServiceLoader, supporting page navigation between multiple projects and decoupled communication between modules. Through comprehensive interceptors and fallback strategies, developers can efficiently handle complex business logic and improve the overall availability of the App.

// technical analysis

WMRouter is a component-based routing framework designed for the Android platform, with its core architecture based on URI dispatching and SPI (Service Provider Interfaces) design principles. This framework aims to solve pain points in multi-project development such as module decoupling, complex page navigation logic, and cross-module communication, improving the maintainability and scalability of the App through unified routing management. In terms of technical decisions, WMRouter adopts annotation-based automatic configuration and compile-time checks, which ensures functional flexibility while minimizing the impact on compilation time, and provides comprehensive debugging and fallback strategies to enhance online stability.

// key highlights

01
Provides powerful URI dispatching capabilities, supporting regex matching and multi-Scheme/Host/Path configurations to meet complex page navigation requirements.
02
Built-in interceptor mechanism supports both global and local interception, making it easy to implement asynchronous business logic such as login and location checks before navigation.
03
ServiceLoader module based on SPI principles achieves interface decoupling and efficient communication between modules.
04
Supports page Exported control and global fallback strategies, effectively improving the App's security and exception handling capabilities.
05
Optimized Gradle plugin design ensures minimal interference with compilation performance while providing compile-time configuration checks.
06
Comprehensive debugging and tracking support, allowing developers to quickly locate navigation issues and monitor business data.

// use cases

01
Unified page navigation and dynamic parameter handling in Native and H5 hybrid development.
02
Unified management of URI navigation from outside the App and implementation of initialization flow control.
03
Inter-module communication and dependency injection functions in multi-project component-based development.

// getting started

Developers can start using WMRouter by adding the dependency (Group ID: io.github.meituan-dianping) to their project. It is recommended to first consult the "Design and Usage Documentation" provided by the project to understand the basic usage of annotation configuration and interceptors, and refer to the sample code in the documentation for page registration and service definition.