{"id":9688,"date":"2019-03-06T13:55:45","date_gmt":"2019-03-06T11:55:45","guid":{"rendered":"https:\/\/www.fandroid.info\/?page_id=9688"},"modified":"2019-03-06T14:37:32","modified_gmt":"2019-03-06T12:37:32","slug":"lecture-1-introduction-to-the-architecture-of-client-server-android-applications-part-1","status":"publish","type":"page","link":"https:\/\/www.fandroid.info\/lecture-1-introduction-to-the-architecture-of-client-server-android-applications-part-1\/","title":{"rendered":"Lecture 1. Introduction to the architecture of client-server android applications. Part 1"},"content":{"rendered":"\n
We present the tutorial on the architecture<\/a> of client-server android applications based on the materials of the course of Arthur Vasilov, which was held at Google Developers Group 2016 in Kazan.<\/p>\n\n\n\n Before proceeding directly to the study of how to build the architecture of client-server Android-applications, it would be good to know why this topic is important at all.<\/p>\n\n\n\n And this question is logical. First, the user is completely indifferent to the architecture of your application. Seriously, how many of you, when using programs and applications, often think about whether they did MVP or MVC? The answer is no one. Secondly, working with architecture requires additional efforts: it needs to be created, it needs to delve into and teach people how to work on it. But in order to create a clearer picture for answering this question, we need to return to the relatively recent past, namely in 2007 and 2008, when the first versions of iOS and Android devices were released, respectively.<\/p>\n\n\n\n We must admit that Google managed to lag behind Apple in terms of entering the mobile market and this led to some consequences, namely to the rush when the first version of Android was released. There is nothing surprising in that Google aspired first of all to finish the basic user functions, and care of convenience of developers was the second priority. Therefore, along with the first version of Android, Google did not provide developers with any standard recommendations for either development, or design and UX. That led to the fact that every developer or every company was forced to write as they wanted and as they could.<\/p>\n\n\n\n Of course, we must admit that in the future Google did a great job of popularizing the Android system among developers. But at the same time the original problems were not completely solved.<\/p>\n\n\n\n What are these problems? In terms of design, it is clear that completely different styles of applications confuse the user of the Android system, and it can be difficult to navigate. But what’s wrong with the lack of standards in the code itself? After all, as it was said just above, the user can not know in any way how good the code of your application is, and this does not affect its use. The problem is that not all developers have a good knowledge of design patterns and are able to develop a good application architecture. If you do not follow clear principles in architecture, you will very soon receive a code that:<\/p>\n\n\n\n This situation lasted long enough. Applications for Android continued to be written in different styles with completely different approaches to design and architecture. Someone was taking a design from the iOS system, and design patterns from Web development (in particular, attempts to use MVC in Android owe their existence to the Web developers who have switched to Android). And it’s hard to say why there were no attempts to fix this situation, Android is a very young system, and by the time of its release all the design patterns and architectural patterns were already widely known.<\/p>\n\n\n\n In general, everything went on as usual until 2014, when two important events happened at once. The first is well known to everyone — this is the presentation of the Material Design concept on Google I \/ O. You can treat this concept differently, someone considers it unsuccessful, someone says that in this way Google restricts the freedom of developers in choosing a design. But the fact that the emergence of this concept greatly improved the situation on average, is unquestionable.<\/p>\n\n\n\n <\/span><\/p>\n\n\n\n It’s clear that the Google I \/ O conference is being monitored by everyone and that Google has put a lot of effort into popularizing the Material Design philosophy, so that Material Design was doomed to be used by everyone. But another significant event happened with less popularity, as it was just an article. This article <\/a>is «Architecting Android … The clean way?» By Fernando Cejas. In fact, these are just an adaptation of the principles <\/a>of Clean Architecture from «Uncle Bob» (Robert Martin) for use in Android. This article gave a huge push (and it is quite possible that this is just a coincidence and the article came out at a time when developers were already ready to look for better solutions) in the development of application architecture.<\/p>\n\n\n\n To put it briefly (and we will take a closer look at the course), a good architecture should allow writing tests for classes containing business logic and should build application modules independent of almost all external elements. And if to speak even easier, your code should be testable and it should be easy to apply and pleasant to read. The quality of the application code can even be measured by the standard unit of measure — the amount of WTF per minute (from Robert Martin’s book \u201cClean Code<\/a>\u201d).<\/p>\n\n\n\n Now we can roughly imagine what is required of us when building the application architecture and can go directly to the consideration of all topics!<\/p>\n\n\n\n So what is the complexity of creating client-server Android-applications that would satisfy all the principles that were described earlier? There are 2 major problems, each of which in fact can be broken down into even more problems:<\/p>\n\n\n\n These problems also have to be solved when creating a competent and correct architecture, and it is always not very simple. Moreover, sometimes it is impossible to achieve the desired result, and each method has its own shortcomings and advantages. We will study all these methods throughout the course, and after that you will be able to decide exactly how you want to develop client-server applications.<\/p>\n\n\n\n Part 2 Lectures 1 Course on the architecture of android applications:<\/p>\n\n\n\nIntroduction to the architecture of android applications<\/h2>\n\n\n\n
The main tasks in the development of client-server applications<\/h2>\n\n\n\n