On app architecture design in Android Application Development

As the first blog in 2017, we must have some overall information. However, as a developer with a little experience in Android development but dare not be called big, we must say ugly Yin Mao, so we set this title. This article briefly introduces my personal understanding of APP architecture. If there are any mistakes, please leave a message to correct and communicate.

First, what is the purpose of APP architecture design?

When I first started writing app, I only paid attention to interface design and logic jump. I didn't know much about how to save time by typing code. (of course, this has also trained a good hand speed). For a small app, it may not take a month to complete it, but in case of large projects, it will be good to rely on the package to integrate one line of code and knock it down one by one. It will be good to knock the code out in three or four months, and we have to add logic. I'm afraid the whole set will pass in the second half of the year. Therefore, we advocate to design the architecture of the project before the project, which can not only save the time of post code and increase the development efficiency, but also not get confused logically because the things to be done by various classes are clear.

Therefore, the architecture of coder and app is like workers laying the foundation of buildings. First straighten out the bottom layer of the architecture. It can not only get twice the result with half the effort in the later development stage, but also ensure that the whole app is stable and free of bugs after it is put into operation.

So, is there anything to follow in the architecture design of app?

1、 High foundation in the early stage of the project

At the beginning of the project, there is no fixed implementation routine for each function, which determines that the same function has different implementation technologies. At the same time, the problem of deriving functions from the initial function 1 in later iterations should be considered. Therefore, more user-defined elements can be added on the basis of ensuring efficient development. To put it simply, when designing the lowest base class, you only need to provide the simplest main methods, and also follow the abstraction principle of design patterns.

2、 High robustness in the middle of the project

In the middle stage of the project, the development focuses on the processing of business logic. Therefore, whether it is network requests or data caching and parsing, the general processing must ensure the integrity and comprehensiveness of the processing. At this time, if there is less if judgment here and more data caching there, the overall development cycle may be delayed.

3、 High expansibility in the later stage of the project

At the later stage of project development, some functions or logic may be added, deleted or modified due to changes in requirements, business logic, technical requirements and other reasons. It can be said that this is the best time to detect the quality of the project architecture. Within the reasonable scope of modification, if the top-level code can be easily modified, it will undoubtedly prove that the overall architecture is perfect in the code development stage.

Finally, what aspects does the general architecture include?

One is UI interface display and interaction

As an android app, it doesn't interact with users or even show users information. The heart of this app is broken. Therefore, the design of the underlying architecture must determine where to initialize the interface, where to assign values to the interface, where to interact with the interface, and so on. In this regard, Google's official recommended architecture is to use databinding, so it should be a good choice for us to correctly use and encapsulate databinding in the project.

The other is network request and cache

In a narrow sense, the knowledge JSON string or text of network request, in a broad sense, includes downloading and caching technologies such as pictures and videos. Therefore, there are still many and miscellaneous contents in this aspect. Normal network request frameworks include okhttp, volley, Android async HTTP, etc. Picture loading frameworks include Picasso, glass, etc. video downloads include third-party vitamio, which is not optimistic. There is also the popular live broadcasting technology last year. At present, it seems that there is no better framework, but you can make your own wheels.

If you integrate the above two basic frameworks and add other frameworks separately required by your own project, it will be the underlying architecture of the whole app project. Therefore, this task is not simple at all.

The above are just personal opinions. If there are any mistakes, please leave a message to criticize and correct them.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>