Article Directory
Preface
Do not remember Shashi Hou, Android launched Android Jetpack, it is a new generation of components, tools and architectural guidance, designed to accelerate Android application development speed.
Android Jetpack divided into four blocks: Architecture, UI, Foundationy and Behavior, not how attention before, now and then go find a lot more things, really admire these Android engineers, the latest map below.
(FIG. 1-Android Jetpack)
Of course, now there are many bloggers who have written a lot of articles on this series, it does not matter, we can use a complete project to explain how the use of this Jetpack
Jetpack architectural components
I saw someone before introducing the AAC (Android Archicture Components), said to be a new application architecture, and holds many lessons can solve encountered in the development of the factors of disharmony
Lifecycles
I believe many people have already used it, in fact, the role of this thing is to be transferred to the business layer Activity / Fragment life cycle by listeners mode onlyLiveData
, And this stuff just makes sense to use with Lifecycles, based on observer mode, and can sense the life cycle of the holders of the classViewModel
+Data Binding
: This thing is mvvm things WellRoom
, Looked at the source code, all kinds of notes, in fact, is the stuff of database operationsWorkManager
: This thing is really a good thing, providing a one-stop solution to our implementation of background tasks;Paging
: The ability to help us cope with load large data problems;Navigation
: It is no use doing this they get to know, look back
AAC architecture
(FIG. 2-Android Architecture)
Jetpack UI Components
Slice: Good things fresh
cameraX: also need to look at
Epilogue
Do not worry, Eat Hot Tofu
We come slowly introduce these components