Summary of common third-party frameworks used in Android development

1. Volley 

project address https://github.com/smanikandan14/Volley-demo
 (1) Asynchronous download of JSON, images, etc.;
 (2) Scheduling of network requests
 (3) Priority processing of network requests
 (4 ) ) Cache
 (5) Multi-level cancellation request
 (6) Linkage with Activity and life cycle (all network requests are cancelled at the same time when the Activity ends)

2. Android -async-http  

project address: https://github.com/loopj/android-async-http
Document introduction: http://loopj.com/android-async-http/ 
 (1) Process in anonymous callback Request result
 (2) HTTP request outside the UI thread
 (3) File breakpoint upload
 (4) Smart retry
 (5) Default gzip compression
 (6) Support parsing into Json format
 (7) Cookies can be persisted to SharedPreferences

3. Afinal framework

project address: https://github.com/yangfuhai/afinal
There are four main modules:
 (1)  Database module: the orm framework in android, which uses the thread pool to operate sqlite.
 (2) Annotation module: The ioc framework in android can perform UI binding and event binding in a fully annotated way. No need to findViewById and setClickListener etc.
 (3) Network module: Encapsulate http data requests through httpclient, support ajax loading, and support the functions of downloading and uploading files.
 (4) Picture caching module: When loading bitmap through FinalBitmap, imageview does not need to consider the phenomenon of oom and picture misalignment when the android container slides quickly during the bitmap loading process.
             FinalBitmap can configure the number of thread loading threads, cache size, cache path, loading display animation, etc. The memory management of FinalBitmap uses the lru algorithm and
             does not use weak references (Google no longer recommends using weak references after android2.3. After android2.3, soft references and weak references are forcibly recovered. For details, see
             the official android documentation), better manage bitmap memory . FinalBitmap can customize the downloader to extend other protocols to display network pictures, such as ftp. At the same time, you can customize the bitmap display,
             play animation when the imageview displays the picture, etc. (the default is the gradient animation display).

4、xUtils框架

项目地址:https://github.com/wyouflf/xUtils
主要有四大模块:
  (1) 数据库模块:android中的orm框架,一行代码就可以进行增删改查;
            支持事务,默认关闭;
            可通过注解自定义表名,列名,外键,唯一性约束,NOT NULL约束,CHECK约束等(需要混淆的时候请注解表名和列名);
            支持绑定外键,保存实体时外键关联实体自动保存或更新;
            自动加载外键关联实体,支持延时加载;
            支持链式表达查询,更直观的查询语义,参考下面的介绍或sample中的例子。          
  (2) 注解模块:android中的ioc框架,完全注解方式就可以进行UI,资源和事件绑定;
            新的事件绑定方式,使用混淆工具混淆后仍可正常工作;
            目前支持常用的20种事件绑定,参见ViewCommonEventListener类和包com.lidroid.xutils.view.annotation.event。
  (3) 网络模块:支持同步,异步方式的请求;
            支持大文件上传,上传大文件不会oom;
            支持GET,POST,PUT,MOVE,COPY,DELETE,HEAD,OPTIONS,TRACE,CONNECT请求;
            下载支持301/302重定向,支持设置是否根据Content-Disposition重命名下载的文件;
            返回文本内容的请求(默认只启用了GET请求)支持缓存,可设置默认过期时间和针对当前请求的过期时间。            
  (4) 图片缓存模块:加载bitmap的时候无需考虑bitmap加载过程中出现的oom和android容器快速滑动时候出现的图片错位等现象;
            支持加载网络图片和本地图片;
            内存管理使用lru算法,更好的管理bitmap内存;
            可配置线程加载线程数量,缓存大小,缓存路径,加载显示动画等...

5、ThinkAndroid

项目地址:https://github.com/white-cat/ThinkAndroid
主要有以下模块:
  (1)  MVC模块:实现视图与模型的分离。
  (2)  ioc模块:android中的ioc模块,完全注解方式就可以进行UI绑定、res中的资源的读取、以及对象的初始化。 
  (3)  数据库模块:android中的orm框架,使用了线程池对sqlite进行操作。  
  (4)  http模块:通过httpclient进行封装http数据请求,支持异步及同步方式加载。
  (5)  缓存模块:通过简单的配置及设计可以很好的实现缓存,对缓存可以随意的配置
  (6)  图片缓存模块:imageview加载图片的时候无需考虑图片加载过程中出现的oom和android容器快速滑动时候出现的图片错位等现象。
  (7)  配置器模块:可以对简易的实现配对配置的操作,目前配置文件可以支持Preference、Properties对配置进行存取。
  (8)  日志打印模块:可以较快的轻易的是实现日志打印,支持日志打印的扩展,目前支持对sdcard写入本地打印、以及控制台打印
  (9)  下载器模块:可以简单的实现多线程下载、后台下载、断点续传、对下载进行控制、如开始、暂停、删除等等。
  (10) 网络状态检测模块:当网络状态改变时,对其进行检

6、LoonAndroid 

项目地址:https://github.com/gdpancheng/LoonAndroid
主要有以下模块:
  (1)  自动注入框架(只需要继承框架内的application既可)
  (2)  图片加载框架(多重缓存,自动回收,最大限度保证内存的安全性)
  (3)  网络请求模块(继承了基本上现在所有的http请求)
  (4)  eventbus(集成一个开源的框架)
  (5)  验证框架(集成开源框架)
  (6)  json解析(支持解析成集合或者对象)
  (7)  数据库(不知道是哪位写的 忘记了)
  (8)  多线程断点下载(自动判断是否支持多线程,判断是否是重定向)
  (9)  自动更新模块
  (10) 一系列工具类

 

 

7、KJFrameForAndroid

项目地址:http://git.oschina.net/kymjs/KJFrameForAndroid#git-readme

github项目地址:
https://github.com/kymjs/KJFrameForAndroid
备用项目地址:
http://git.oschina.net/kymjs/KJFrameForAndroid

KJFrameForAndroid 又叫KJLibrary,是一个android的orm 和 ioc 框架。同时封装了android中的Bitmap与Http操作的框架,使其更加简单易用;
KJFrameForAndroid的设计思想是通过封装Android原生SDK中复杂的复杂操作而达到简化Android应用级开发,最终实现快速而又安全的开发APP。我们提倡用最少的代码,完成最多的操作,用最高的效率,完成最复杂的功能。
同时,KJFrameForAndroid是免费的、开源的、简易的、遵循Apache Licence 2.0开源协议发布的android应用开发框架,总共分为五大模 块:UILibrary,UtilsLibrary,HttpLibrary,BitmapLibrary,DBLibrary。

 

8、AndroidAnnotations

xUtils是国内比较火的快速开发框架,但是它的注解机制不是太稳定而且注解可选也比较少,国外的一个框架主要专注于注解的开发,简化Android代码编写,它除了有依赖注入的特性以外,还集成了Ormlite,spring-android中的REST模板。使用起来非常方便,大大提高了开发效率。

1.下载AndroidAnnotations:

   Git官网:https://github.com/excilys/androidannotations

项目中重要的两个jar包分别是:androidannotations-api-3.0.1.jar和androidannotations-3.0.1.jar
2.新建一个android项目,然后将androidannotations-api-3.0.1.jar复制到libs目录下,在项目的根目录新建一个文件夹,命名为compile-libs,然后将androidannotations-3.0.1.jar复制到该目录下

3.在你的工程上右键单击,在弹出的菜单中选择"Properties",找到Java Compiler,确保Compiler compliance level设置为1.6,否则的话处理器将不起作用

4.然后设置项目属性:右键->Properties->Java Compiler->Annotation Processing 在该页面选中Enable project specific settings。

5.转到Java Compiler 中的 Annotation Processing 下边的 Factory Path,在此将androidannotations-3.0.1.jar添加到其中。

 

注解1:@ViewById 与findViewById功能相似,如果ViewById后没有设置资源ID的话,就是自动查找与变量名称相同的id资源。

注解2:@Click 点击事件处理的注解。

注解3:@UiThread 后台Ui线程的注解,省去了Handler等等。

Annotation 4: @EActivity prompts the annotation of Activity. Note that this annotation compiles Activity into Activity_. Note that there is one more underscore "_", so it needs to be added in the AndroidManifest.xml file.

Note 5: @AfterViews refers to the code executed after the View class is injected.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326413156&siteId=291194637