Top ten frameworks commonly used in Android

This article is a multi-party synthesis and reprint integration. It is intended to be able to know and use some useful third-party support in Android development, saving a lot of time. Most of the following involves the rise and fall and test of history, and there are talents in the country. A generation is stronger than a generation, and some have been replaced by newer and more usable ones, but there are still many places that are worth mentioning and there is no lack of reference, some are still classic, please refer to the sorting out. Welcome everyone's corrections, additions and exchanges.

1. AndBase framework

   Project address:  https://code.jd.com/zhaoqp2010_m/andbase

1.andbase contains a large number of common development methods.

Such as network download, multi-threading and thread pool management, database ORM, image cache management, image file download and upload, Http request tools, common tools (string, date, file processing, image processing tools, etc.) The application reduces redundant code in team development, greatly improves code maintenance and development efficiency, and can well avoid common mistakes caused by negligence in development.

2.andbase encapsulates a large number of commonly used controls.

Such as list paging, pull-down refresh, image carousel, table, multi-threaded downloader, sidebar, image upload, wheel selection, chart, Tab sliding, calendar selector, etc.

3. Powerful AbActivity, you have no reason not to inherit it.

Inherit it and you can get a simple and powerful configurable action bar, as well as a series of simple calls, such as pop-up box, prompt box, progress box, sub-action bar, etc.

4. Provide a high-efficiency picture cache management strategy, which greatly saves memory, improves utilization, and improves efficiency.

To manage a large number of image resources in the program, andbase provides a simple method to complete the download and display in a few steps, and supports zooming, cropping, and caching functions.

5. Encapsulates a large number of common tool classes.

Including various processing functions such as date, character, file, picture, etc., there are many and all.

6. Use andbase to greatly reduce the use of handlers, and use callback functions to make the code cleaner.

The handler generates a lot of code and is not easy to maintain. Andbase encapsulates the handler.

7. Simple and lightweight ORM framework that supports annotation and automatic table creation (supports one/many-to-many association operations).

Writing sql, building tables, the workload is heavy, andbase provides more foolish asynchronous addition, deletion, modification and query tools.

8. Asynchronous request http framework, network request standardization, support file upload and download, get, post, progress display.

Contains tool classes for asynchronous and http requests, which are practical.

 

2. XUtil framework

     Project address: https://github.com/wyouflf/xUtils

There are four main modules:

(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内存;
            可配置线程加载线程数量,缓存大小,缓存路径,加载显示动画等...

3、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) 网络状态检测模块:当网络状态改变时,对其进行检

 

4、LoonAndroid

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

5、volley

  项目地址 https://github.com/smanikandan14/Volley-demo
(1)  JSON,图像等的异步下载;
(2)  网络请求的排序(scheduling)
(3)  网络请求的优先级处理
(4)  缓存
(5)  多级别取消请求
(6)  和Activity和生命周期的联动(Activity结束时同时取消所有网络请求)

6、android-async-http

 项目地址:https://github.com/loopj/android-async-http
 文档介绍:http://loopj.com/android-async-http/
(1) 在匿名回调中处理请求结果
(2) 在UI线程外进行http请求
(3) 文件断点上传
(4) 智能重试
(5) 默认gzip压缩
(6) 支持解析成Json格式
(7) 可将Cookies持久化到SharedPreferences

7、Afinal框架

 项目地址:https://github.com/yangfuhai/afinal
主要有四大模块:
(1) 数据库模块:android中的orm框架,使用了线程池对sqlite进行操作。
(2) 注解模块:android中的ioc框架,完全注解方式就可以进行UI绑定和事件绑定。无需findViewById和setClickListener等。
(3) 网络模块:通过httpclient进行封装http数据请求,支持ajax方式加载,支持下载、上传文件功能。
(4) 图片缓存模块:通过FinalBitmap,imageview加载bitmap的时候无需考虑bitmap加载过程中出现的oom和android容器快速滑动时候出现的图片错位等现象。
             FinalBitmap可以配置线程加载线程数量,缓存大小,缓存路径,加载显示动画等。FinalBitmap的内存管理使用lru算法,
             没有使用弱引用(android2.3以后google已经不建议使用弱引用,android2.3后强行回收软引用和弱引用,详情查看android官方文档),
             更好的管理bitmap内存。FinalBitmap可以自定义下载器,用来扩展其他协议显示网络图片,比如ftp等。同时可以自定义bitmap显示器,
             在imageview显示图片的时候播放动画等(默认是渐变动画显示)。

总结框架结构,

ImageLoader框架(第8大框架)

UniversalImageLoader是用于加载图片的一个开源项目,在其项目介绍中是这么写的,

  • 支持多线程图片加载
  • 提供丰富的细节配置,比如线程池大小,HTPP请求项,内存和磁盘缓存,图片显示时的参数配置等等;
  • 提供双缓存
  • 支持加载过程的监听;
  • 提供图片的个性化显示配置接口;
  • Widget支持(这个,个人觉得没必要写进来,不过尊重原文)

其他类似的项目也有很多,但这个作为github上著名的开源项目被广泛使用。第三方的包虽然好用省力,可以有效避免重复造轮子,但是却隐藏了一些开发上的细节,如果不关注其内部实现,那么将不利于开发人员掌握核心技术,当然也谈不上更好的使用它,计划分析项目的集成使用和低层实现。


开源框架android-async-http(第9大框架)

官网:https://github.com/loopj/android-async-http


Android-async-http开源框架可以是我们轻松的获取网络数据或者向服务器发送数据,使用起来也简单,详细请看官网:

到官网下载zip包,解压,里面有完整的代码和各种版本的jar包和demo,源码在library里面,jar包在releases里面。项目更新速度很快,老版本的回调是一个普通类,最新版是一个接口。


KJFrameForAndroid框架(第10大框架)

参考:http://www.codeceo.com/article/android-orm-kjframeforandroid.html


KJFrameForAndroid是一款基于Android的ORM和 IOC应用开发框架,封装了很多Android开发中常用的功能,包括Android中对Bitmap的操作类库。KJFrameForAndroid的设计非常精简,利用KJFrameForAndroid,我们可以用最少的代码完成很多丰富的Android功能应用,为Android开发者节省许多不必要的开发时间。

KJFrameForAndroid is divided into five modules: UILibrary, UtilsLibrary, HttpLibrary, BitmapLibrary, DBLibrary.


The Android -async-http open source framework allows us to easily obtain network data or send data to the server. It is also simple to use. Please see the official website for details:

Go to the official website to download the zip package, unzip it, there are complete codes and various versions of jar packages and demos, the source code is in the library, and the jar package is in the releases. The project is updated very quickly. The callback of the old version is a common class, and the latest version is an interface.

Guess you like

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