All Projects → mqzhangw → Jimu

mqzhangw / Jimu

Licence: apache-2.0
一种简单有效的android组件化方案,支持组件的代码资源隔离、单独调试、集成调试、组件交互、UI跳转、生命周期等完整功能。

Programming Languages

java
68154 projects - #9 most used programming language
groovy
2714 projects
kotlin
9241 projects

Projects that are alternatives of or similar to Jimu

Ddcomponentforandroid
一套完整有效的android组件化方案,支持组件的组件完全隔离、单独调试、集成调试、组件交互、UI跳转、动态加载卸载等功能
Stars: ✭ 3,281 (+39.32%)
Mutual labels:  android-architecture, android-application, android-component
Armscomponent
📦 A complete android componentization solution, powered by MVPArms (MVPArms 官方快速组件化方案).
Stars: ✭ 1,664 (-29.34%)
Mutual labels:  android-architecture, android-application, android-component
Android Spotify Mvp
Android Sample to explain Model View Presenter in android applications.
Stars: ✭ 184 (-92.19%)
Mutual labels:  android-architecture, android-application
Androidroom
Android example to show how to use Room to access SQLite database on device for reading and writing data. This example also shows how to use LiveData and ViewModel with Room to build reactive, well performing and easy to maintain applications.
Stars: ✭ 36 (-98.47%)
Mutual labels:  android-architecture, android-application
Android Mvp Architecture
Sample app to show basics of Model-View-Presenter (MVP) architectural pattern
Stars: ✭ 79 (-96.65%)
Mutual labels:  android-architecture, android-application
Cc
业界首个支持渐进式组件化改造的Android组件化开源框架,支持跨进程调用。Componentize your android project gradually.
Stars: ✭ 3,863 (+64.03%)
Mutual labels:  android-architecture, android-component
Android Arsenal.com
Source to android-arsenal.herokuapp.com
Stars: ✭ 541 (-77.03%)
Mutual labels:  android-architecture, android-application
Dagger2 Sample
A sample app to demo how to implement dagger in Android using Dagger Android Support library
Stars: ✭ 72 (-96.94%)
Mutual labels:  android-architecture, android-application
Kotlin Cleanarchitecture
This is a sample app that is part of a blog post I have written about how to architect android application using the Uncle Bob's clean architecture and Fernando Cejas Android-CleanArchitecture in Kotlin. Post in Spanish: http://katade.com/clean-architecture-kotlin/
Stars: ✭ 274 (-88.37%)
Mutual labels:  android-architecture, android-application
Android Inappbilling
A sample which uses Google's Play Billing Library and it does InApp Purchases and Subscriptions.
Stars: ✭ 114 (-95.16%)
Mutual labels:  android-architecture, android-application
Cameraxdemo
A sample camera app with CameraX API from Android Jetpack
Stars: ✭ 112 (-95.24%)
Mutual labels:  android-architecture, android-application
Droid Feed
Aggregated Android news, articles, podcasts and conferences about Android Development
Stars: ✭ 174 (-92.61%)
Mutual labels:  android-architecture, android-application
Canaree Music Player
Complete music player published in the Play Store. Heavily relies on Dagger, kotlin coroutines and Clean architecture.
Stars: ✭ 371 (-84.25%)
Mutual labels:  android-architecture, android-application
Android Clean Architecture Boilerplate
An android boilerplate project using clean architecture
Stars: ✭ 3,534 (+50.06%)
Mutual labels:  android-architecture, android-application
Androidkex
Extensions for Kotlin. Use the power of Kotlin to make your code smaller and beautiful.
Stars: ✭ 35 (-98.51%)
Mutual labels:  android-architecture, android-application
Permissionsflow
A simple library to make it easy requesting permissions in Android using Kotlin Coroutines.
Stars: ✭ 49 (-97.92%)
Mutual labels:  android-architecture, android-application
Calculator-Plus
A Simple Calculator with rich features for daily use.
Stars: ✭ 14 (-99.41%)
Mutual labels:  android-application, android-architecture
Android Mvp Sample Application
Android MVP Sample Application
Stars: ✭ 260 (-88.96%)
Mutual labels:  android-architecture, android-application
Mediapicker
Easy customizable picker for all your needs in Android application
Stars: ✭ 105 (-95.54%)
Mutual labels:  android-architecture, android-application
Mvparms
⚔️ A common architecture for Android applications developing based on MVP, integrates many open source projects, to make your developing quicker and easier (一个整合了大量主流开源项目高度可配置化的 Android MVP 快速集成框架).
Stars: ✭ 10,146 (+330.83%)
Mutual labels:  android-architecture, android-application

JIMU

PRs Welcome License

项目介绍

JIMU(积木)是一套Android组件化框架,支持组件的代码资源隔离、单独调试、集成调试、组件交互、UI跳转、生命周期等完整功能。

取名为JIMU(积木),其含义是应用这套框架可以做到组件之间的完全隔离,每个组件可以单独运行,同时又可以通过“接口”任意拼接成一个完成APP,这种能力就是我们实施组件化的最终目的。

最新版本

2021-06-10补充: 因为我的错误操作,导致发布到MavenCentral的版本:

  • build-gradle:1.3.5
  • componentlib: 1.3.3
  • router-anno-compiler: 1.0.1 均出现了Pom文件错误,遗失了dependency,再问题被修正前,可以按照hotfix-bad-pom分支的内容,做紧急修复。致歉 -- leobert

2021-05-23补充: 受JFrog运营策略影响,项目重新发布到MavenCentral,注意仓库变更

release-note&change-logs 关注版本变更以及注意事项是个好习惯。

模块 build-gradle componentlib router-anno-compiler router-annotation
最新版本 Download Download Download Download

实现功能:

  • 组件可以单独调试
  • 杜绝组件之前相互耦合,代码完全隔离,彻底解耦
  • 组件之间通过接口+实现的方式进行数据传输
  • 使用scheme和host路由的方式进行activity之间的跳转
  • 自动生成路由跳转路由表
  • 任意组件可以充当host,集成其他组件进行集成调试
  • 可以动态对已集成的组件进行加载和卸载
  • 支持kotlin组件
  • 组件独立运行的Manifest可以基于“壳”和组件原始的Manifest合并生成(from version 1.3.4)
  • 组件初始化支持按序(from version 1.3.4)这部分基于Maat, 参考博客

原理解析

组件化设计思路 浅谈Android组件化

原理解释请参考文章Android彻底组件化方案实践

demo解读请参考文章Android彻底组件化demo发布

按序初始化业务组件请参考文章组件化:代码隔离也难不倒组件的按序初始化

单项目,多module背景下,依赖方式的优雅实践探索:三思系列:组件化场景下module依赖优雅实践方案

使用指南

1、主项目引用编译脚本

在根目录的gradle.properties文件中,增加属性:

mainmodulename=app

其中mainmodulename是项目中的host工程,一般为app

添加mavenCentral仓库

在根目录的build.gradle中增加配置

buildscript {
    dependencies {
        classpath 'io.github.leobert-lan:jimu-build-gradle:A.B.C'
    }
}

A.B.C是版本号,最新的版本号可以参考上面的MavenCentral外链

为每个组件引入依赖库,如果项目中存在basiclib等基础库,可以统一交给basiclib引入

compile 'io.github.leobert-lan:jimu-componentlib:A.B.C'

注意GroupId和ArtifactId在重新发布到MavenCentral后已经变更

'componentLib'        : 'io.github.leobert-lan:jimu-componentlib:{version}',
'router_anno'         : 'io.github.leobert-lan:jimu-router-annotation:{version}',
'router_anno_compiler': 'io.github.leobert-lan:jimu-router-anno-compiler:{version}',

2、拆分组件为module工程

在每个组件的工程目录下新建文件gradle.properties文件,增加以下配置:

isRunAlone=true
debugComponent=sharecomponent
compileComponent=sharecomponent

上面三个属性分别对应是否单独调试、debug模式下依赖的组件,release模式下依赖的组件。具体使用方式请解释请参见上文第二篇文章

3、应用组件化编译脚本

在组件和host的build.gradle都增加配置:

apply plugin: 'com.dd.comgradle'

注意:不需要在引用com.android.application或者com.android.library

同时增加以下extension配置:

combuild {
    applicationName = 'com.luojilab.reader.runalone.application.ReaderApplication'
    isRegisterCompoAuto = true
}

组件注册还支持反射的方式,有关isRegisterCompoAuto的解释请参见上文第二篇文章

1.3.4新特性
def projectRoot = project.getRootProject().rootDir.absolutePath

combuild {
    applicationName = 'com.luojilab.reader.runalone.application.ReaderApplication'
    isRegisterCompoAuto = false

    originalManifest = projectRoot + "/readercomponent/src/main/AndroidManifest.xml"

    runAloneManifest = projectRoot + "/readercomponent/src/main/runalone/AndroidManifest.xml"
    targetManifest = projectRoot + "/readercomponent/src/main/runalone/mergedManifest.xml"
    //如果不需要合并,改为false
    enableManifestMerge = true
}

增加了5个可配项目:

  • useMaat 默认为true,本处没有写,如果你不打算使用Maat,务必改为false,否则会织入代码并发生ClassNotFoundException
  • originalManifest 原始manifest文件路径
  • runAloneManifest 一个壳manifest,用于指定独立运行时额外需要的权限、Application配置,启动Activity、额外的四大组件,metadata
  • targetManifest 合并后输出的manifest,需要先创建文件,runalone使用的manifest;如不先创建会影响gradle任务,被认为是一个缺失manifest的Component!
  • enableManifestMerge 如果是true,则会在合适的时机执行manifest合并功能,并且插件中增加的如:runaloneMergeDebugManifest等任务会执行合并,否则该任务并不会合并manifest文件

4、混淆

在混淆文件中增加如下配置

-keep interface * {
  <methods>;
}
-keep class com.luojilab.component.componentlib.** {*;}
-keep class com.luojilab.gen.router.** {*;}
-keep class * implements com.luojilab.component.componentlib.router.ISyringe {*;}
-keep class * implements com.luojilab.component.componentlib.applicationlike.IApplicationLike {*;}

注意:com.luojilab.component.componentlib和com.luojilab.gen.router包可能在项目迁移的过程中发生过或即将发生变化,文档更新不一定及时,请手工确认一下生成类的包路径。

关于如何进行组件之间数据交互和UI跳转,请参看 Wiki 关于消息中间件,请参考v1.3.3releaseNote

组件化讨论群

JIMU的讨论群,群号693097923,欢迎大家加入:

进群请扫码

PS:最近千人群满了,建议一些基础性问题仔细琢磨下文章,比较麻烦的问题提issue求助。

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].