Introduction to six recommended Android open source frameworks

Introduction to six recommended Android open source frameworks

1. Volley

Project address: https://github.com/smanikandan14/Volley-demo

Asynchronous downloading of JSON, images, etc.;
Scheduling of network requests
Priority processing of network requests, caching of multi-level cancellation requests, and linkage between Activity and life cycle (all network requests are canceled at the same time when Activity ends)

2. android-async-http

Project address: https://github.com/loopj/android-async-http, Document introduction: http://loopj.com/android-async-http/

Process request results in anonymous callbacks Make http requests outside the UI thread Upload files at breakpoints Intelligent retry Default gzip compression Support parsing into Json format Cookies can be persisted to SharedPreferences

3. Afinal Framework

Project address: https://github.com/yangfuhai/afinal

There are four main modules:

Database module: The orm framework in Android uses a thread pool to operate sqlite.
Annotation module: The IOC framework in Android, which can perform UI binding and event binding completely through annotations. No need to findViewById and setClickListener, etc.
Network module: encapsulates http data requests through httpclient, supports Ajax loading, and supports downloading and uploading file functions.
Image cache module: Through FinalBitmap, when imageview loads bitmap, there is no need to consider the OOM that occurs during bitmap loading and the image misalignment that occurs when the Android container slides quickly.

FinalBitmap can configure the number of thread loading threads, cache size, cache path, loading display animation, etc. FinalBitmap's memory management uses the lru algorithm, and does not use weak references (Google no longer recommends using weak references after Android 2.3, and forcibly reclaims soft references and weak references after Android 2.3, for details, see the Android official document), to better manage bitmap memory. FinalBitmap can customize the downloader to expand other protocols to display network images, such as ftp, etc. At the same time, you can customize the bitmap display,

Play animations when the imageview displays pictures (the default is gradient animation display).
4. xUtils framework

Project address: https://github.com/wyouflf/xUtils, there are four main modules:

Database module:

The orm framework in Android can add, delete, modify and query with just one line of code;
Support transactions, closed by default;
You can customize table names, column names, foreign keys, unique constraints, NOT NULL constraints, CHECK constraints, etc. through annotations (please annotate table names and column names when confusion is required);
Supports binding foreign keys. When saving an entity, the foreign key-associated entity is automatically saved or updated.
Automatically load foreign key related entities and support delayed loading;
Supports chained expression queries and more intuitive query semantics. Please refer to the following introduction or examples in the sample.

Annotation module:

The ioc framework in Android can perform UI, resource and event binding completely through annotations;
New event binding method, which can still work normally after being obfuscated by obfuscation tools;
Currently supports 20 commonly used event bindings, see View Common Event Listener class and package com.lidroid.xutils.view.annotation.event.

Network Module:

Support synchronous and asynchronous requests;
Support large file upload, no OOM when uploading large files;
Support GET, POST, PUT, MOVE, COPY, DELETE, HEAD, OPTIONS, TRACE, CONNECT requests;
Download supports 301/302 redirection, and supports setting whether to rename the downloaded file according to Content-Disposition;
Requests that return text content (only GET requests are enabled by default) support caching, and you can set a default expiration time and an expiration time for the current request.

Image cache module:

When loading a bitmap, you do not need to consider the OOM that occurs during the bitmap loading process and the image misalignment that occurs when the Android container slides quickly.
Support loading network pictures and local pictures;
Memory management uses the LRU algorithm to better manage bitmap memory;
You can configure the number of thread loading threads, cache size, cache path, loading display animation, etc.

5. ThinkAndroid

Project address: https://github.com/white-cat/ThinkAndroid

The main modules are as follows:

MVC module: realizes the separation of view and model.
ioc module: The ioc module in Android can perform UI binding, reading resources in res, and initializing objects through complete annotation.
Database module: The orm framework in Android uses a thread pool to operate sqlite.
http module: encapsulates http data requests through httpclient and supports asynchronous and synchronous loading.
Cache module: Cache can be well implemented through simple configuration and design, and the cache can be configured arbitrarily. Picture cache module: When imageview loads pictures, there is no need to consider the OOM that occurs during the picture loading process and the picture misalignment that occurs when the Android container slides quickly.
Configurator module: It can implement pairing configuration operations in a simple way. Currently, the configuration file can support Preference and Properties to store and access the configuration.
Log printing module: can realize log printing quickly and easily, support log printing extension, currently supports writing local printing to sdcard, and console printing. Downloader module: can simply realize multi-threaded downloading, background downloading, breakpoint resumption, download control, such as start, pause, delete, etc.
Network status detection module: When the network status changes, it is detected.

6. LoonAndroid

Project address: https://github.com/gdpancheng/LoonAndroid

The main modules are as follows:

Automatically inject the framework (just inherit the APP in the framework)
Image loading framework (multiple caches, automatic recycling, and maximum memory security)
Network request module (inherits basically all current http requests)
eventbus (integrating an open source framework)
Verification framework (integrated open source framework)
Json parsing (supports parsing into collections or objects)
Database (I don't know who wrote it, I forgot)
Multi-threaded breakpoint download (automatically determine whether multi-threading is supported and whether it is redirection)
Automatic update module series of tools

Among them, Volley was studied in 2013. It has very good scalability and is my favorite style. Others such as Android-async-http and Afinal are also quite good.

<<:  Hundreds of iOS apps exposed to FREAK vulnerability risk

>>:  .com is 30 years old, is he old?

Recommend

How much carbon can a tree store? Different trees have different abilities

When it comes to reducing carbon emissions, we al...

Mobile QQ 8.2.8 update: Image text extraction is easier

[[316739]] Today, Tencent QQ Android and iPhone m...

Flying to Jupiter's North Pole and Saturn: Pioneer 11丨Planetary Tour

Pioneer 11 was the first probe to explore Saturn ...

7 minefields of big data marketing, how many have you stepped on?

Nowadays, when talking about marketing, if you do...

11 suggestions on how to carry out ground promotion in a refined manner

Since I started my business and entered the field...

What is so great about the Y-20?

Mixed Knowledge Specially designed to cure confus...

Until the day before his death, he was still writing in his diary...

"Sunny to cloudy East wind level 1 to 2 This...

To newbies in App operation: Have you tried these App promotion channels?

In the early stage of App operation, how to expos...