头图

Author/Developer Relations Engineer Manuel Vicente Vivo

As Android applications continue to scale, it becomes important to use the architectural design code appropriately so that the application extends , improves its quality and robustness , and

The application architecture defines the boundaries between parts of the application and the responsibilities each part should assume. This follows the Separation of principle, which is conducive to achieving the above advantages.

In response to community demand for the latest guidelines for application architecture, we have published Revised Application Architecture Guidelines , which include best practices and recommended architectures for building robust, high-quality applications. The guide also provides instructions for each layer of the recommended architecture: interface layer , domain layer and data layer . There you can find deep dives into more complex topics, such as how to handle interface events .

Every Android application should contain at least two layers:

You can add an additional domain layer to simplify and reuse the interaction between the interface and the data layer.

△ 典型应用架构的一般示意图。

△ General schematic diagram of typical application architecture.

The UI layer obtains application data from an optional domain layer or a data layer that exposes application data.

We have created a study plan to help you understand these in sequence in a traceable manner.

You can also get badges for completing the study, and the wonderful learning content is not to be missed!

Choose the way that suits you

If you are a beginner , you should first understand the benefits of follow these recommendations as your preferred method of diving into the subject. Intermediate and advanced developers can follow these recommendations and to . In fact, our research shows that most professional developers are already using these best practices.

You may be wondering if your existing schema should be updated to follow this advice, the answer is... it's up to you. If your current architecture is right for your team, there's nothing wrong with keeping it the same. However, it's also possible that you can find something from our guide that you can benefit from and incorporate it into your app.

Looking forward to more exciting

These are the first documents we've released, with more to come this year. You are welcome to help us improve our guide! If you have any feedback on the current proposal, or if you'd like to see other architecture-related topics in it, please let us know on the official issue tracker page . You are also welcome to keep following us for more latest content.


Android开发者
404 声望2k 粉丝

Android 最新开发技术更新,包括 Kotlin、Android Studio、Jetpack 和 Android 最新系统技术特性分享。更多内容,请关注 官方 Android 开发者文档。