Android Modular Development with the Spider Framework
This article introduces the Spider framework used at Qunar for Android modular development, explaining its architecture, component model, development and release workflow, performance benefits, dynamic loading features, and provides a quick‑start guide with examples and resources.
The Qunar Technical Carnival featured a session on Android modular development using the Spider framework, an internal solution that evolved from dynamic loading to a comprehensive set of tools for building modular Android applications.
Framework Overview : Spider organizes each functional unit as an Atom , managed by an AtomManager . Every Atom contains its own ClassLoader for dex files and a ResourcesManager for assets such as layouts and themes.
Component Types : Atoms are classified as business components or library components. This separation enables complete decoupling via scheme‑based communication and allows reusable library code to be invoked directly.
App Architecture : When Spider is integrated, the app stack consists of the Android Runtime, Spider Runtime, optional base libraries, library Atoms, and reusable business components, allowing flexible composition (e.g., a hotel client can embed a car‑ticket component).
Development & Release Process :
Teams work independently; business teams have autonomous release rights, eliminating cross‑team negotiations.
Build and release speeds improve dramatically—development builds up to 10× faster, release builds up to 4× faster.
Code and release permissions are fully isolated per component.
Dynamic Loading Comparison : Spider’s loading mechanism supports on‑demand loading without configuration, handles dependency chains, and distinguishes between library and business component dependencies (the latter identified by package name and version code).
Case Study : The Qunar car‑ticket app, built with Spider, reuses many modules from the main Qunar client. A single developer completed the app in roughly three days, demonstrating the framework’s efficiency.
Quick‑Start Guide :
Clone a template project and set the launch URL.
Select required library and business Atoms (existing or newly created).
Use the cloud‑build platform to trigger an APK build.
Create custom components following standard Android development practices.
Additional resources such as QR codes, download links for the demo apps, and links to the Qmobile video and PPT are provided for further exploration.
Qunar Tech Salon
Qunar Tech Salon is a learning and exchange platform for Qunar engineers and industry peers. We share cutting-edge technology trends and topics, providing a free platform for mid-to-senior technical professionals to exchange and learn.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.