(Translated by https://www.hiragana.jp/)
GitHub - G-Joker/WeaponApp: 一个尽量做到极致的集大成App,努力做到最好(开发阶段)——MVVM+Retrofit+RxJava+Small 插件化+单元测试+MD
Skip to content

一个尽量做到极致的集大成App,努力どりょく做到さいこのみ(开发阶段)——MVVM+Retrofit+RxJava+Small 插件+单元测试+MD

Notifications You must be signed in to change notification settings

G-Joker/WeaponApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

WeaponApp

WeaponApp

Contact Us

Developers: WeaponZhi, hiyangyue, xiaweizi, foxlee

AI Geek Workshop - Public account, welcome to follow us if you are interested in AI!

image.png

An ultimate App. A learning project to help you enhance your ability to independently develop the business layer of Android applications. This development framework enables rapid application building. You can also use it as a tool app for reference in your daily development.

Package Building Methods:

gradlew cleanLib
gradlew buildLib -q -Dbundle.arch=x86
gradlew cleanBundle
gradlew buildBundle -q -Dbundle.arch=x86
  • -q represents the clean mode, displaying only the packaging results of the plugin.
  • In -Dbundle.arch, use x86 for emulator debugging and armeabi for physical device debugging.

In Case of App Crash on Physical Device:

  1. Check the logs in Logcat and locate the error.
  2. If there are no obvious error logs, or if the error is PushReceiver ClassNotFoundException, please determine the CPU type of the physical device and package accordingly.

You can obtain the CPU type through:

adb shell
cat /proc/cpuinfo  

For example, Redmi Note 3:

Processor	: AArch64 Processor rev 2 (aarch64)

The corresponding packaging command should be changed to:

# For '.so' files, differentiate CPU architecture. 
# Generally, use 'x86' for emulators and 'armabi armeabi-v7a arm64-v8a' for physical devices.
gradlew buildLib -q -Dbundle.arch=arm64-v8a
gradlew buildBundle -q -Dbundle.arch=arm64-v8a

Script Packaging Method:

buildAll        # Full packaging
buildBundle     # Package only the Bundle if Lib remains unchanged
buildAll q d    # Equivalent to adding '-q' and '-Dbundle.arch=x86'
buildBundle q d # Equivalent to adding '-q' and '-Dbundle.arch=x86'

If there are errors during packaging, you can first execute gradlew cleanBuild and then retry the packaging process.

For detailed packaging command parameters, please refer to the Small documentation: Small Documentation

Development Methodology: Test-Driven Development (TDD)

TDD requires writing test code before writing the actual code for a feature. Then, you write only the code necessary to pass the tests. This process helps in producing concise, usable, and high-quality code, ultimately accelerating the development process.

TDD indirectly assists programmers in writing well-designed code. To ensure testability, the classes and methods in the code must strictly adhere to the Single Responsibility Principle.

Furthermore, with the encapsulated MVVM framework, you can test the entire page logic by performing unit tests only on the ViewModel layer methods, constructing empty View and Model parameters.

Development Framework: MVVM

This project utilizes a highly encapsulated MVVM framework and databinding for efficient development. This framework allows for rapid business logic development while abstracting the underlying databinding technical details. As a result, even developers who are not deeply familiar with MVVM and databinding can develop smoothly by following the framework's flow.

Moreover, this framework facilitates effortless unit testing. The specific development process of MVVM and unit testing operations will be supplemented in subsequent development stages.

Technology Stack

This project will integrate, encapsulate, and redevelop the most widely used, professional, and popular technologies in the current Android landscape, applying them to practical scenarios. The currently planned technologies for introduction include (bolded items indicate secondary development or fully self-developed libraries):

  • DataBinding + MVVM Development
  • Component-Based Development
  • Small Plugin Framework
  • Databinding
  • Custom Server
  • Custom Gradle Plugin
  • Integrated Official Sharing for QQ, WeChat, and Weibo
  • Cross-Platform Push Notification Service
  • UMeng Statistics
  • OkHttp + Retrofit + RxJava
  • Refresh List Library Extended from RecyclerView
  • Component-Based Controls
  • Unit Testing
  • Integrated Debugging for Components
  • Instant Messaging
  • Video Service
  • Material Design
  • Glide

Submission Specifications

  • [func] do sth: Feature development
  • [fixbug] #xx# do sth: Bug fix, where #xx# is the issue number
  • [docs] do sth: Documentation
  • [chore] do sth: Build-related modifications
  • [test] do sth: Adding test code
  • [optimize] do sth: Optimizing parts of the code
  • [style] do sth: Code formatting, removing blank lines, etc., not related to functionality

Integrated Debugging Method

Set DEBUG to true in gradle.properties to enable the integrated debugging environment. Set the corresponding modules you need to debug to true.

For instance, if you need to debug the mine and message modules, set DEBUG, DEVELOP_MINE, and DEVELOP_MESSAGE to true, and then re-sync Gradle.

When DEBUG is set to false, it represents a full package compilation or Release mode, where all modules are added by default, ignoring the individual configuration boolean values of the modules below.


联系わが

开发じんWeaponZhi,xiaweizi,hiyangyue,foxlee

AI极客研修けんしゅう-作者さくしゃWeaponZhiてきおおやけ众号,对AIゆう兴趣てきわらわ鞋欢むかえ关注~

image.png

QQ1Group

いち个极致的Appがく习项,帮助你提ます独自どくじ开发 Android 业务层的能力のうりょくもと于该开发かまち以快そく构建应用,どう时你以当做一个工 App,以供你平时开发参考さんこう

せいつつみつつみ方式ほうしき

gradlew cleanLib
gradlew buildLib -q -Dbundle.arch=x86
gradlew cleanBundle
gradlew buildBundle -q -Dbundle.arch=x86

其中 -q 代表だいひょうせい洁模しきただいた插件てきつつみ结果しんいき

-Dbundle.arch ちゅう,如果拟器调试,则是x86,如果つくえ调试则是armeabi

如遇つくえ启动奔溃

请先检查Logcatしたてきこころざし,并定位ていいいた对应てき错误。わか无明显的错误こころざしあるものこれPushReceiver ClassNotFoundExceptionてき错误,请先确定つくえてきCPUてき类型,并根すえ类型进行しょう应的つつみ

つう

adb shell
cat /proc/cpuinfo  

てき方式ほうしき获取CPU类型,如红まい note 3:

Processor	: AArch64 Processor rev 2 (aarch64)

对应てきつつみ则更换为

#soばん区分くぶんCPU构,一般いっぱん拟器使用しよう x86,つくえ使用しよう armabi armeabi-v7a arm64-v8a
gradlew buildLib -q -Dbundle.arch=arm64-v8a
gradlew buildBundle -q -Dbundle.arch=arm64-v8a

脚本きゃくほんつつみ方式ほうしき

buildAll        全量ぜんりょうつつみ
buildBundle     ただつつみBundle,Libぼつあらため变
buildAll q d    相当そうとう于加-q  -Dbundle.arch=x86
buildBundle q d 相当そうとう于加-q  -Dbundle.arch=x86

つつみ如果现异つね以先输入 gradlew cleanBuild,さいじゅうしん执行いちへんつつみりゅうほど 详细つつみ指令しれいさんすう参考さんこうSmallぶん档:Smallぶん

开发方法ほうほう测试驱动开发

要求ようきゅうざい编写ぼう个功のうてきだい码之まえさき编写测试だい码,しかきさきただ编写使测试どおり过的こう能代のしろ码,つう过测试来推动せい个开发的进行。这有じょ于编うつし简洁可用かようだか质量てきだい码,并加そく开发过程。

测试驱动开发かいはんこう帮助ほどじょ员编うつし设计せい良好りょうこうてきだい码,为了证代码的测性,要求ようきゅうだい码中てき类和方法ほうほう必须严格遵循单一せいげん则。

どう时,つう过已经封そうこうてき MVVM かまち以只どおり单元测试 ViewModel 层方ほう,构造そらてき View Model さんすう,从而测试せい个页めん逻辑。

开发かまちMVVM

つう过高ふうそうてき MVVM かまち配合はいごうdatabinding进行だかこう开发,つう过该かまち以快そくてき进行业务逻辑てき开发,对 databinding そこ层技术进ぎょう隐藏,そく使つかいほどじょ员对 MVVM Databinding 理解りかいふか,按照かまちりゅうほど也可以顺畅开发。

并且どおり过该かまち以轻まつてき进行单元测试,MVVM てき具体ぐたい开发りゅうほど单元测试操作そうさはたざいきさき续开发过ほどちゅう补充。

わざ术栈

わが们将ざい项目ちゅう集成しゅうせいふうそう开发现在 Android 领域使用しよう最多さいたさい专业,さい热门てきわざ术,并实ようざい项目ちゅう目前もくぜん计划引入てきわざ术有(字体じたい为二次开发或者完全自主开发库):

  • DataBinding+MVVM开发
  • 组件开发
  • Small 插件かまち
  • Databinding
  • けんふく务器
  • てい义 Gradle 插件
  • 集成しゅうせいQQ、ほろしんじほろはくかんかたぶんとおる
  • ぜん平台ひらだい推送ふく
  • ともめい统计
  • OkHttp + Retrofit + RxJava
  • つう过 RecyclerView つぶせてんてき刷新さっしんれつひょう
  • ひかえけん组件
  • 单元测试
  • 组件集成しゅうせい调试
  • そく时通讯
  • 视频ふく
  • Material Design
  • Glide

ちゅうくび页数すえ样式参考さんこう于慕课网组件视频 https://coding.imooc.com/learn/list/84.html 使用しよう项目MVVMおもしん实现 かん谢 qndroid ろう

ひさげ交规范

  • [func] do sthこうのう开发
  • [fixbug] #xx# do sth:Bug おさむあらため,#ごうない为 issue 编号
  • [docs] do sthぶん
  • [chore] do sth:buildしょう关的おさむあらため
  • [test] do sth添加てんか测试だい
  • [optimize] do sth: 优化部分ぶぶんだい
  • [style] do sth: 格式かくしきじょうてき格式かくしき、删除空白くうはくぎょうとう,无关こうのう

集成しゅうせい调试方法ほうほう

ざい gradle.properties ちゅう DEBUG 为 true 则打开集成しゅうせい调试环境,需要じゅよう哪几个模块联调,就把下面かめんてき对应块置为 true。

如我よう联调 mine message 块,就把DEBUGDEVELOP_MINEDEVELOP_MESSAGEおけ为true,しかきさきおもしんどういちGradleそく

DEBUG おけ为 false てき时候为整つつみ编译あるもの理解りかい为Releaseしきはただま添加てんか所有しょゆう块,ゆるがせりゃく下面かめん块的单独配置はいちぬの尔值。

单元测试设计おもえあずか使用しよう方法ほうほう

まち补充

まち补充

未完みかんまち续,目前もくぜんせい迭代ちゅう...

About

一个尽量做到极致的集大成App,努力どりょく做到さいこのみ(开发阶段)——MVVM+Retrofit+RxJava+Small 插件+单元测试+MD

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •