preface

When it comes to Android architecture, the first things that come to mind are MVC, MVP, and MVVM. They are focused on views and models. With the development of Android, from the original framework is very little, it is all do-it-yourself. Now there are more and more frameworks and more types of models, leading to more and more non-standard development. We know that MVP and MVVM only apply to architecture, not to framework selection. In 2018, Google launched Jetpack to address these issues.

What is Jetpack?

Jetpack is not a new architecture, but a suite of libraries that help developers follow best practices, reduce boilerplate code and write code that runs consistently across Android versions and devices, allowing developers to focus on writing important code.

The advantage of the Jetpack

If you need to use Jetpack, your boss won’t agree to change without some advantages. Here’s a look at jetpack’s advantages:

  • Jetpack has life-cycle awareness capabilities to reduce NPE crashes and memory leaks. For us to develop a robust and smooth program to provide a strong guarantee.

  • Jetpack can help make Android development more efficient by reducing boilerplate code.

Android Jetpack?

Android Jetpack, for Google, is a manifestation of their determination to reorganize and unify the Android ecosystem. What Android Jetpack shows is also the direction that Google wants to expand and maintain. For Android developers who have long agonized over third-party library choices, this is a beacon for us.

Some of the Libraries in the Android Jetpack family may not be ready to be your first choice for your job, but digging into the Android Jetpack component will give you the opportunity to talk to the Big guns at Google and bring some ideas to your day-to-day development.

How to learn?

If you are lack of learning materials, and I just collected this ali ten years of technical experts to jointly create the “latest” “Jetpack strengthening actual combat manual,” is the sunflower treasure for you to learn Jetpack. The following text begins:

First understand ConstraintLayout implementation login page

1. Create project 2. Immersive layout 3. Rich text 4. Property animation

The main framework of APP and Navigation are introduced

1. Set up Bottom Navigation Activity 2. Navigation jump 3.Navigation transfer value 4.Navigation jump animation 5. 6.Deeplink navigation

3. Use Coroutines, Retrofit and Moshi to implement network data requests

1. Kotlin-coroutine 2. Implementing network requests with coroutines and Retrofit

Four, use TabLayout, ViewPager2, RecyclerView to achieve the song list square page

1.ViewPager2 2.TabLayout 3.RecyclerView 4. Network data request and data filling 5. Optimize the interface

Five, song list page MVVM architecture transformation and the use of ViewModel and LiveData introduction

1.MVC and MVVM 2. Modify the playlist page

Vi. Paging implements loading more and pull-down refresh, and rerequests after errors

Advantages of Paging 2.Paging achieves more Paging loading 3. Combining Paging and SwipRefreshLayout achieves drop-down refresh 4. Add Footer to RecyclerView 5. Retry after network error 6. The frame of animation

Seven, vlayout nesting transverse RecyclerView and Banner home page display, custom Moshi JsonAdapter

1. Vlayout architecture analysis 2. Vlayout introduction 3. Basic work preparation 4. Vlayout implementation of the rotation diagram 5. Inconsistent field content types

Room database to achieve increase, delete, change, check and transaction processing

Add Room dependency 2.Room details 3. Insert data during DataBase creation 4

Room database Migration

Create Entity 2. Create Dao 3. Modify Database 4. Modify HomeViewModel 5. Migration

ExoPlayer for video playback implementation

1.ExoPlayer introduction 2.ExoPlayer simple usage method 3.ExoPlayer simple customization 4.ExoPlayer advanced customization 5

MotionLayout makes animation so easy

1. Basic MotionLayout 2. Keyframes 3. 4.MotionLayout case analysis

12. Detailed explanation of basic knowledge of Kotlin Flow

1. Scenario 2 introduced Flow. The Flow characteristics of 3. 4. The structure of the Flow function Flow computing function among 5. 6. End of the Flow function Flow error exception handling 7. 8. The cancellation of the Flow/StateFlow MutableStateFlow

Kotlin Flow project – Network, database and UI application

1. The position left for Flow in MVVM architecture 2. Network data request 3. The database

14. View Binding replaces ButterKnife and Kotlin Synwide-footing

1. FindViewById () 2.View Binding () 3. From Kotlin Synwide-footing to View Binding

Please click here to obtain the complete document for free.