Top Related Projects
A powerful and lightweight plugin framework for Android
A small framework to split app into small parts
WMRouter是一款Android路由框架,基于组件化的设计思路,有功能灵活、使用简单的特点。
A hotfix library for Android platform, and not just this...
零反射全动态Android插件框架
RePlugin - A flexible, stable, easy-to-use Android Plug-in Framework
Quick Overview
Atlas is a powerful Android Dynamic Component Framework developed by Alibaba. It enables developers to build flexible and scalable Android applications by supporting dynamic deployment of components, hot-fixing, and resource isolation. Atlas aims to solve common issues in large-scale Android app development, such as slow build times and difficulties in modularization.
Pros
- Supports dynamic deployment of components, allowing for faster updates and reduced app size
- Provides hot-fixing capabilities, enabling quick bug fixes without full app updates
- Offers resource isolation, reducing conflicts between different modules
- Improves build times and overall development efficiency for large-scale Android projects
Cons
- Steep learning curve for developers unfamiliar with component-based architecture
- Requires significant changes to existing project structure and build processes
- May introduce additional complexity in app management and versioning
- Limited documentation and resources available in English
Code Examples
- Defining a bundle in Atlas:
@ActComponent
public class MyBundle extends AtlasBundle {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Initialize bundle
}
}
- Loading a remote bundle:
BundleUtil.fetchBundle("com.example.remotebundle", new BundleUtil.FetchBundleCallback() {
@Override
public void onSuccess(Bundle bundle) {
// Bundle loaded successfully
}
@Override
public void onFailed(String errorMsg) {
// Handle error
}
});
- Accessing resources from another bundle:
Resources remoteResources = Atlas.getInstance().getRemoteResource("com.example.remotebundle");
int remoteStringId = remoteResources.getIdentifier("remote_string", "string", "com.example.remotebundle");
String remoteString = remoteResources.getString(remoteStringId);
Getting Started
- Add Atlas to your project's
build.gradle
:
buildscript {
dependencies {
classpath 'com.taobao.android:atlasplugin:3.0.0'
}
}
apply plugin: 'com.taobao.atlas'
- Configure Atlas in your app's
build.gradle
:
atlas {
bundleConfig {
awbBundle {
// Define your bundles here
}
}
}
- Initialize Atlas in your Application class:
public class MyApplication extends AtlasApplication {
@Override
public void onCreate() {
super.onCreate();
Atlas.getInstance().setClassNotFoundInterceptorCallback(new ClassNotFoundInterceptorCallback() {
@Override
public Class<?> returnDefaultClass(String className) {
// Handle class not found errors
return null;
}
});
}
}
Competitor Comparisons
A powerful and lightweight plugin framework for Android
Pros of VirtualAPK
- Simpler implementation and easier to integrate into existing projects
- Better support for dynamic loading of resources and assets
- More flexible plugin management system
Cons of VirtualAPK
- Less comprehensive documentation compared to Atlas
- Smaller community and fewer updates
- Limited support for complex multi-process scenarios
Code Comparison
VirtualAPK:
PluginManager pluginManager = PluginManager.getInstance(context);
pluginManager.loadPlugin(pluginPath);
Intent intent = new Intent();
intent.setClassName("com.example.plugin", "com.example.plugin.MainActivity");
startActivity(intent);
Atlas:
Atlas.getInstance().installBundle(bundleFile);
ClassLoader classLoader = Atlas.getInstance().getBundleClassLoader(bundleName);
Class<?> clazz = classLoader.loadClass("com.example.plugin.MainActivity");
Intent intent = new Intent(context, clazz);
startActivity(intent);
Both VirtualAPK and Atlas aim to provide dynamic component loading and plugin architecture for Android applications. VirtualAPK offers a more straightforward approach with easier integration, while Atlas provides a more comprehensive framework with better documentation and community support. The code examples demonstrate the different approaches to loading and launching plugin components in each framework.
A small framework to split app into small parts
Pros of Small
- Simpler setup and integration process
- Lighter weight and more focused on plugin functionality
- Better suited for smaller projects or those needing basic plugin support
Cons of Small
- Less comprehensive features compared to Atlas
- Limited documentation and community support
- May not scale as well for large, complex applications
Code Comparison
Small:
public class PluginManager {
public void loadPlugin(String pluginPath) {
// Load plugin implementation
}
}
Atlas:
public class Atlas {
public void installBundle(String bundlePath) {
// Install bundle implementation
}
public void updateBundle(String bundleName, String bundlePath) {
// Update bundle implementation
}
}
Key Differences
- Small focuses on plugin management, while Atlas offers a more comprehensive component-based architecture
- Atlas provides more advanced features like dynamic deployment and hot fixes
- Small has a simpler API, making it easier to integrate for basic plugin functionality
- Atlas offers better support for large-scale applications with multiple components
Use Cases
- Small: Ideal for projects requiring basic plugin support or lightweight modular architecture
- Atlas: Better suited for complex, large-scale applications needing advanced component management and dynamic updates
Community and Support
- Atlas has stronger backing from Alibaba and a larger community
- Small has less documentation and fewer resources available
WMRouter是一款Android路由框架,基于组件化的设计思路,有功能灵活、使用简单的特点。
Pros of WMRouter
- Lightweight and focused specifically on routing in Android apps
- Simpler setup and integration process
- Better support for deep linking and custom URL schemes
Cons of WMRouter
- Less comprehensive than Atlas for overall app modularization
- Fewer features for dynamic loading and hot-fixing
- Limited support for multi-process architecture
Code Comparison
WMRouter:
@RouterUri("http://example.com/user")
public class UserActivity extends Activity {
@RouterParam("id")
long userId;
}
Atlas:
@Component
public class UserComponent {
@Autowired
UserService userService;
@RouterPath("/user/{id}")
public void showUser(@PathVariable("id") long userId) {
// Handle user display
}
}
WMRouter focuses on simple annotation-based routing, while Atlas provides a more comprehensive component-based architecture with dependency injection and modular design. Atlas offers more flexibility for large-scale applications but requires more setup and configuration. WMRouter is easier to implement for basic routing needs but may lack advanced features for complex app structures.
A hotfix library for Android platform, and not just this...
Pros of Amigo
- Simpler implementation and easier to integrate into existing projects
- Focuses specifically on Android app size reduction and optimization
- More active development and recent updates
Cons of Amigo
- Less comprehensive feature set compared to Atlas
- Limited documentation and community support
- Primarily targets app size reduction, while Atlas offers broader functionality
Code Comparison
Atlas:
Atlas atlas = Atlas.getInstance();
Bundle bundle = atlas.getBundle("com.example.bundle");
bundle.start();
Amigo:
Amigo.init(this);
Amigo.loadPatch(this, patchFile);
Summary
Atlas is a more comprehensive solution for modular development and dynamic deployment of Android apps, offering features like hot-fixing and dynamic component loading. It has a larger codebase and more extensive documentation.
Amigo, on the other hand, is primarily focused on reducing app size and optimizing performance. It offers a simpler implementation and is easier to integrate into existing projects. However, it has a more limited feature set and less community support compared to Atlas.
Both projects aim to improve Android app development, but they target different aspects of the development process. Atlas is better suited for large-scale, modular applications, while Amigo is ideal for projects prioritizing app size reduction and performance optimization.
零反射全动态Android插件框架
Pros of Shadow
- More flexible plugin management system, allowing for dynamic loading and unloading of plugins
- Better support for multi-process architecture, improving app stability and performance
- More active development and community support, with frequent updates and contributions
Cons of Shadow
- Steeper learning curve due to its more complex architecture
- Potentially higher memory usage in some scenarios
- Less mature documentation compared to Atlas
Code Comparison
Atlas:
AtlasBundleInfoManager.instance().getBundleInfo("com.example.bundle");
Atlas.getInstance().installBundle(bundleFile);
Shadow:
val pluginManager = Shadow.getPluginManager()
pluginManager.loadPlugin("com.example.plugin")
pluginManager.callApplicationOnCreate(pluginPkgName)
Summary
Both Atlas and Shadow are powerful Android dynamic component frameworks, but they have different strengths. Atlas offers a more straightforward approach with better documentation, while Shadow provides greater flexibility and multi-process support. Shadow's active development and community support give it an edge in terms of ongoing improvements and adaptability to new Android features. However, its complexity may require more time for developers to master. The choice between the two depends on specific project requirements and team expertise.
RePlugin - A flexible, stable, easy-to-use Android Plug-in Framework
Pros of RePlugin
- More flexible plugin management, allowing dynamic loading and unloading of plugins at runtime
- Better compatibility with Android versions and third-party ROMs
- Simpler integration process, requiring fewer modifications to the host app
Cons of RePlugin
- Slightly larger APK size due to additional plugin management code
- Potential performance overhead from dynamic plugin loading
- Less mature ecosystem compared to Atlas
Code Comparison
RePlugin plugin declaration:
@PluginConfig(
pluginName = "demo1",
hostApplicationName = "com.qihoo360.replugin.sample.host"
)
public class Demo1 extends PluginApplication {
// Plugin code
}
Atlas bundle declaration:
@ActComponent
@SuppressWarnings("unused")
public class DemoComponent {
@AutoLoad(name = "com.taobao.firstbundle.FirstBundleActivity")
public void initFirstBundle() {
// Bundle initialization code
}
}
Both RePlugin and Atlas aim to provide modular app development solutions for Android, but they differ in their approaches. RePlugin focuses on runtime flexibility and ease of integration, while Atlas offers a more comprehensive framework with tighter integration into the build process. The choice between the two depends on specific project requirements and development preferences.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Atlas
A powerful Android Dynamic Component Framework.
Atlas is an Android client-side containerization framework. we call it android dynamic component framework.
Atlas provides decoupled, component, and dynamic support. Atlas covers various issues in the project coding period, Apk run-time and follow-up operation and maintenance.
In the project period, Atlas enable engineers independent development, independent debug, because their project were physical isolation.
In the apk run-time, Atlas has complete component life cycle, class isolation and other mechanisms.
In the operation and maintenance period, Atlas provide rapid incremental update and rapid upgrade capacity.
Atlas put the work into the project period as much as possible, to ensure runtime simple and stable, maintenance easy.
Compared with multidex solution, Atlas not only solved the limitation of the method count(65535), but also clarified the boundary of development, provied the powerful capabilities for Android development, such as Parallel Iteration, Rapid Development, Flexible Release, Dynamically Update, Quick Fix Online Failure.
Unlike some Android plugin frameworks, Atlas is a component framework (we call it Bundle), Atlas is not a multi-process framework.
You can see there were three main library in this project (atlas-core/atlas-update/atlas-gradle-plugin)
- atlas-core: This is client-side core library, it's job is to install each bundle, load the classes and resources on-demand when runtime.
- atlas-update: This is client-side update library, which provide dexmerge capacity for update or upgrade.
- atlas-gradle-plugin: This is Android Studio Gradle Plugin for engineers developing in project period, because we change some android default package mechanisms, include android aapt atlas-aapt.
Use Atlas
- Demo
- Doc: English, ä¸æ
- DingTalk im group: Scan the follow QR code or Search group 11727755 using DingTalk(éé) app.
Support
Atlas support all Android version from Android 4.0 to 9.0.
Follow is support status.
Runtime | Android Version | Support |
---|---|---|
Dalvik | 2.2 | Not Test |
Dalvik | 2.3 | Not Test |
Dalvik | 3.0 | Not Test |
Dalvik | 4.0-4.4 | Yes |
ART | 5.0 | Yes |
ART | 5.1 | Yes |
ART | M | Yes |
ART | N | Yes |
ART | 8.0 | Yes |
ART | 9.0 | Yes |
Top Related Projects
A powerful and lightweight plugin framework for Android
A small framework to split app into small parts
WMRouter是一款Android路由框架,基于组件化的设计思路,有功能灵活、使用简单的特点。
A hotfix library for Android platform, and not just this...
零反射全动态Android插件框架
RePlugin - A flexible, stable, easy-to-use Android Plug-in Framework
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot