Super Android Advanced Route Knowledge Graph: A 10-year journey from grassroots to million-year-paid programmers, and successfully won offers from major factories

Preface

The job-hopping season of Golden 9th and Silver 10th is coming to an end, but it is still not easy to find a job this year. I believe that everyone is in urgent need of an Android interview collection. Let me share with you my long-cherished Android high-level interview collection for your study!

Components in JetPack

The above picture is the list of components included in JetPack. Each component is relatively independent and can be used and constructed separately. Among them, LiveData, ViewModel, Room, Navigation, WorkManager, which are the most introduced and most frequently used, have all released official versions, while CameraX , Compose, etc. are still in the Alpha version and have not been officially released. Not recommended for use in a production environment.

Then, all JetPack components are built on AndroidX. If you want to use JetPack in a project, you need to first change all dependencies on Support Lib in the project to AndroidX .

Android has been in development for 11 years, and it can be said to be a relatively mature technology. At the beginning, there were few frameworks and no specifications. All the code must be written by yourself, such as network requests, database requests, data analysis, and so on. Later, some frameworks appeared to help developers to develop quickly, such as XUtils, Volley, OKHttp, EventBus, etc. With more and more frameworks, an application can have multiple technology options, which directly leads to more and more irregular application development. , Resulting in uneven application quality, which is obviously not what Google wants to see. Google subsequently launched official examples related to MVP and MVVM, the effect is very general, and the coverage is only in the architecture, the Android Jetpack launched at the Goole I/O 2018 conference is expected to solve the above problems.

3. Introduction to Android Jetpack

Jetpack is not a framework or component, it is a collection of libraries, tools and guides that can help developers write high-quality applications more easily. These components help developers follow best practices, get rid of the work of writing boilerplate code, and simplify complex tasks so that they can focus on the code they need.
Many components in Android Jetpack are not newly developed, but have been there very early. For example, Android Architecture Component (AAC) was launched at the Goole I/O 2017 conference, which includes LifeCycle, LiveData, ViewModel, and Room . At the Goole I/O 2018 conference,
the Android Support Library was replaced with AndroidX, and Android Jetpack was released on the basis of Android Architecture Component. AndroidX also belongs to Android Jetpack.

The main features of Jetpack are as follows:

1. Accelerate development.
Components can be used alone or work together. When using Kotlin language features, efficiency can be improved.

2. Eliminate boilerplate code
Android Jetpack can manage tedious activities (such as background tasks, navigation and lifecycle management).

3. Build high-quality powerful applications.
Android Jetpack components are built around modern design practices, with backward compatibility, which can reduce crashes and memory leaks.

Four, Android Jetpack classification

The figure below is the classification of Jetpack.

Google is still constantly improving Android Jetpack. As of August 2019, there are many new components that are not shown in the above picture, such as CameraX. There are 4 types of Android Jetpack categories, namely Architecture, Foundationy, Behavior, and UI, which are introduced below.

1. Architecture (architecture components)

Architecture refers to architectural components that help developers design applications that are robust, testable, and easy to maintain. Architecture components can be said to be the most helpful components for application development. This series also focuses on architecture components.

DataBinding : Declaratively bind observable data to interface elements, usually used in conjunction with ViewModel.

Lifecycle : Used to manage the life cycle of Activity and Fragment, which can help developers generate lightweight code that is easier to maintain.

LiveData : Notify the view when the underlying database changes. It is an observable data holder. Unlike regular observables, LiveData is life cycle aware.
Navigation: handles in-app navigation.

Paging : It can help developers to load and display small pieces of data at a time. Loading part of the data on demand can reduce the use of network bandwidth and system resources.

Room : Friendly and smooth access to SQLite database. It provides an abstraction layer based on SQLite, allowing more powerful database access.

ViewModel : Manage interface-related data in a life-cycle manner. It is usually used in conjunction with DataBinding to provide strong support for developers to implement MVVM architecture.

WorkManager : Manage Android background jobs, even if the application exits or the device restarts, it can run delayed asynchronous tasks.

The officially recommended Android application architecture is shown in the figure below.

These architectural components can be used in conjunction or alone, and it is recommended to follow the official recommendations as much as possible.

2. Foundationy (foundation component)

The basic components provide horizontal functions, such as backward compatibility, testing, security, Kotlin language support, and include components developed on multiple platforms.

Android KTX : Optimized Jetpack and Android platform APIs for Kotlin. Help developers use Kotlin for Android development in a more concise, more pleasant, and more idiomatic way.
AppCompat : Help lower versions of Android systems to be compatible.
Auto : Develop components of Android Auto application, providing standardized interface and user interaction applicable to all vehicles.
Detection : Quickly detect Kotlin or Java-based code from AndroidStudio.
Multiple Dex processing : Provide support for applications with multiple Dex files.
Security : Secure reading and writing of encrypted files and sharing preferences.
Testing : An Android testing framework for unit and runtime interface testing.
TV : Build applications that allow users to experience immersive content on the big screen.
Wear OS : Components for developing Wear applications.

3. Behavior (behavior component)

Behavioral components help developers’ applications to integrate with standard Android services (such as notifications, permissions, sharing).

CameraX : Help develop and simplify the development of camera applications. It provides a consistent and easy-to-use interface and is suitable for most Androids. The device is backward compatible to Android 5.0 (API 21).
DownloadManager : A system service that handles long-running HTTP downloads.
Media and playback : Backward compatible API for media playback and routing (including Google Cast).
Notification : Provides a backward compatible notification API, supports Wear and Auto.
Permissions : Compatibility API used to check and request application permissions.
Settings : To create interactive settings, it is recommended to use AndroidX Preference Library to integrate user-configurable settings into the application.
Sharing operation : User-friendly sharing operation can be realized more easily.
Slice : A slice is a UI template that creates flexible interface elements that can display application data outside the application.

4. UI (Interface Components)

Animation and Transition : This framework contains built-in animations for common effects and allows developers to create custom animations and life cycle callbacks.
Emoji Compatibility : Even if the user does not update the Android system, they can get the latest emoji.
Fragment : The basic unit of componentized interface.
Layout : Declare UI elements in XML or instantiate UI elements in code.
Palette : Extract useful information from the palette.

5. Introduce Jetpack related components into the application

Add the google() library in the project build.gradle as shown below.

  allprojects {
        repositories {
            google()
            jcenter()
        }
    }

If you want to introduce Room, you can write this in the module build.gradle:

    implementation   "android.arch.persistence.room:runtime:1.1.1"
    annotationProcessor   "android.arch.persistence.room:compiler:1.1.1 "
    androidTestImplementation  "android.arch.persistence.room:testing:1.1.1"

to sum up

This article is not much inside, and aims to let everyone know what Android Jetpack is, what it includes, and how to cite it. Starting from the next article, you will start to learn the architecture components of Android Jetpack.

Finally, for programmers, there are too many knowledge content and technologies to learn. If you don't want to be eliminated by the environment, you have to constantly improve yourself. It is always us to adapt to the environment, not the environment to adapt to us!

Here I will share a piece of information, hoping to help everyone improve their advanced level.

The content includes: Android learning PDF+architecture video+interview document+source notes , advanced architecture technology advanced mind map, Android development interview topic materials, advanced advanced architecture materials . Share with everyone, it is very suitable for friends who have interviews in the near future and want to continue to improve on the road of technology.

If you need it, you can click on Android learning PDF+architecture video+interview document+source notes to get a free way to receive

If you like this article, you might as well give me a thumbs up, leave a message in the comment area or forward and support it~

F%99%E4%BA%9B%EF%BC%9F%E5%A6%82%E4%BD%95%E9%9D%A2%E8%AF%95%E6%8B%BF%E9%AB%98%E8%96%AA%EF%BC%81.md)

If you like this article, you might as well give me a thumbs up, leave a message in the comment area or forward and support it~

img

Guess you like

Origin blog.csdn.net/m0_52308677/article/details/112957405
Recommended