更新至2019-02-13 简要框架杂谈

简要杂谈

其实也就是只稍稍看了一下一点点源码随口乱说的
会包含对应的github地址也贴出来,也会顺便点出来一些之前没见过知识点

ARouter

github: https://github.com/alibaba/ARouter
一个用于帮助 Android App 进行组件化改造的框架 —— 支持模块间的路由、通信、解耦

  • 路由器功能,配备了拦截器,可以直接activity之间跳转,信息和数据传递等
  • 通过@Route来配置该activity在路由器中的路径和别名
  • javax.annotation.processing用来声明注释处理器并允许注释处理器与注释处理工具环境通信的工具
  • 用了上面说的那个包去做注解后的路由表(有点像是c++的虚函数表)(待详解)

butterknife,也就是所谓的黄油刀

github: https://github.com/JakeWharton/butterknife
Field and method binding for Android views which uses annotation processing to generate boilerplate code for you.

  • 依赖注解框架,没有其他的
  • 支持注解的类型巨多,但其实都读取资源文件夹的id来注解对应对象
  • 使用@IdRes注释方法

Dagger2

github: https://github.com/google/dagger
Dagger 2 is a compile-time evolution approach to dependency injection. Taking the approach started in Dagger 1.x to its ultimate conclusion, Dagger 2.x eliminates all reflection, and improves code clarity by removing the traditional ObjectGraph/Injector in favor of user-specified @Component interfaces.

  • 跟ARouter一样都用了javax.annotation.processing(可能泛用于JAVA的框架都这样??)

Retrofit

gitbub: https://github.com/square/retrofit
Type-safe HTTP client for Android and Java by Square, Inc.

  • 用了OkHttp做网络请求
  • 感觉像是在OkHttp上进行了注解封装(待详解)

OkHttp

github: https://github.com/square/okhttp
An HTTP & HTTP/2 client for Android and Java applications

  • 内部维护一个无上限的线程池

Glide

github: https://github.com/bumptech/glide
Glide is a fast and efficient open source media management and image loading framework for Android that wraps media decoding, memory and disk caching, and resource pooling into a simple and easy to use interface.

GreenDao

github: https://github.com/greenrobot/greenDAO
greenDAO is a light & fast ORM for Android that maps objects to SQLite databases. Being highly optimized for Android, greenDAO offers great performance and consumes minimal memory.

RxJava

github: https://github.com/ReactiveX/RxJava
RxJava is a Java VM implementation of Reactive Extensions: a library for composing asynchronous and event-based programs by using observable sequences.

你可能感兴趣的:(更新至2019-02-13 简要框架杂谈)