Android-open source framework summary

Friends who watched my article for the first time, can follow, like, forward it, and share all kinds of dry goods technology and program fun facts every day

One, volley

(1) Asynchronous download of JSON, images, etc.;

(2) Sorting of network requests (scheduling)

(3) Priority processing of network requests

(4) Cache

(5) Multi-level cancellation request

(6) Linkage with Activity and life cycle (Cancel all network requests at the same time when Activity ends)

Two, android-async-http

(1) Processing request results in anonymous callbacks

(2) Make http requests 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

Three, Afinal framework

There are four main modules:

(1) Database module : the orm framework in android uses a thread pool to operate sqlite.

(2) Annotation module : the ioc framework in android, UI binding and event binding can be done in a fully annotated way. No need to findViewById and setClickListener etc.

(3) Network module : encapsulate http data request through httpclient, support ajax loading, and support downloading and uploading file functions.

(4) Picture cache module :

  • Through FinalBitmap, when imageview loads bitmap, there is no need to consider the oom that occurs during the bitmap loading process and the picture 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. The memory management of FinalBitmap uses the lru algorithm,
  • Weak references are not used (Google has not recommended the use of weak references after android2.3. After android2.3, soft references and weak references are forcibly recycled. For details, please refer to the official android document),
  • 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 etc. when imageview displays pictures (default is gradient animation display).

Four, xUtils framework

There are four main modules:

(1) Database module:

  • In the orm framework in android, one line of code can be added, deleted, modified and checked;
  • Support affairs, closed by default;
  • You can customize the table name, column name, foreign key, unique constraint, NOT NULL constraint, CHECK constraint, etc. through annotations (please annotate the table name and column name when you need to confuse);
  • Supports binding foreign keys, and the foreign key related entities are automatically saved or updated when the entity is saved;
  • Automatically load foreign key related entities, support delayed loading;
  • Support chain expression query, more intuitive query semantics, refer to the introduction below or the example in the sample.

(2) Annotation module :

  • The ioc framework in android can bind UI, resources and events in a fully annotated way;
  • The new event binding method can still work normally after being confused by the obfuscation tool;
  • Currently supports 20 commonly used event bindings

(3) Network module :

  • Support synchronous and asynchronous requests;
  • Support large file upload, uploading large files will not oom;
  • Support GET, POST, PUT, MOVE, COPY, DELETE, HEAD, OPTIONS, TRACE, CONNECT request;
  • 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 the default expiration time and the expiration time for the current request can be set.

(4) Picture cache module :

  • When loading bitmap, there is no need to consider the phenomenon of picture misalignment that occurs during the rapid sliding of the oom and android container during the bitmap loading process;
  • Support loading network pictures and local pictures;
  • Memory management uses lru algorithm to better manage bitmap memory;
  • Configurable thread loading thread number, cache size, cache path, loading display animation, etc...

Five, ThinkAndroid

There are mainly the following modules:

(1)   MVC module : realize the separation of view and model.

(2)   ioc module : the ioc module in android, which can perform UI binding, read resources in res, and initialize objects in a fully-annotated way.

(3)   Database module : the orm framework in android uses a thread pool to operate sqlite.

(4)   http module : encapsulate http data requests through httpclient, and support asynchronous and synchronous loading.

(5)   Cache module : The cache can be implemented well through simple configuration and design, and the cache can be configured at will

(6) Image caching module: When imageview loads images, there is no need to consider the oom and the image misalignment that occur during the fast sliding of the android container during the image loading process.

(7)   Configurator module : It can easily realize the operation of pairing configuration. At present, the configuration file can support Preference and Properties to access the configuration.

(8)   Log printing module : It can realize log printing quickly and easily, and supports the expansion of log printing. Currently, it supports writing to sdcard for local printing and console printing.

(9)   Downloader module : It can simply implement multi-threaded download, background download, resumable upload, and control the download, such as start, pause, delete, and so on.

(10) Network status detection module : when the network status changes, check it

Six, LoonAndroid

There are mainly the following modules:

(1) Automatically inject the framework (only need to inherit the application in the framework)

(2) Picture loading framework (multiple caching, automatic recovery, maximum guarantee of memory safety)

(3) Network request module (inherited basically all current http requests)

(4) eventbus (integrating an open source framework)

(5) Verification framework (integrated open source framework)

(6) json parsing (support parsing into collections or objects)

(7) Database (I don’t know who wrote it and forgot it)

(8) Multi-threaded breakpoint downloading (automatically judge whether it supports multi-threading, and judge whether it is redirection)

(9) Automatic update module

5) Verification framework (integrated open source framework)

(6) json parsing (support parsing into collections or objects)

(7) Database (I don’t know who wrote it and forgot it)

(8) Multi-threaded breakpoint downloading (automatically judge whether it supports multi-threading, and judge whether it is redirection)

(9) Automatic update module