2020 Top 5 Android development technology you need most attention

Author: Jake Lee

Although the programming environment has a new change every day, but Android is undoubtedly one of the most frequently updated iteration, there are new things every month or even every year. This article describes the development of five major Android technology developers in 2020 most in need of attention.

Among the many Android development team attended Droidcon London 2019 conference, a series of dazzling new technology. Accessible from intelligent guitar Joe Birch introduction to the upcoming Jetpack Compose library, innovative content too much, mainstream communities need to find a few core technologies that they will not get lost.

This article will take a look at some of the core technologies we need to focus on, but this article will explain why these technologies, as well as some of the ways to achieve the initial priority should be achieved. Needs to be stressed about the implementation of these technologies though not let your end users amazed, but they can help developers create thrilling features, and code libraries to bring more pleasing for the developers!

1. Kotlin

Kotlin is often seen as the next Java, which is composed of Google and JetBrains (Android Studio developers) sponsorship. Java from the outset has been the language of choice for developing Android applications, but in recent years the rapid spread of Kotlin, there are now nearly 60% in the use of Kotlin 10,000 Google Play applications. Although in the case of a minority need to access the underlying native code, and will continue to use C ++; but in other cases, Kotlin can be replaced by Java.

The main advantage of Kotlin is fully interoperable with Java, which means that developers can migrate legacy code as much as possible, instead of completely rewriting the entire application. The two languages ​​very well compatible, Android Studio can even automatically switch from Java to Kotlin.

This compatibility, coupled with a more concise syntax and hundreds of small improvements, the Kotlin become the fourth largest "most popular" and the fifth largest "want" programming language in 2019 developer survey of StackOverflow, the highest ranking in all mobile programming languages.

Migrate existing applications are a good way, that is, when modifying an existing Java file to convert it to Kotlin. While this means you should frequently files into editable in the past, will increase the complexity of the code review (for example, face a potential conflict), but due to the region after the conversion can be reviewed, it is possible to ensure that any problems can be found.

Currently Kotlin Code Candyspace used in 86% (and has been growing), the remaining 14% of utility / conversion code that changes have not been for some years before.

2. Jetpack

Google's AndroidX / Jetpack library is a set of utilities designed to simplify common application needs. Room e.g. for device database, or the underlying data changes to update the display content LiveData.

With Jetpack library, the new project will save the trouble of re-inventing the wheel, do not have to wait for other developers to open their implementation, every developer can now get to those elements of the foundation. These libraries are updated very frequently, has introduced new features, bug fixes will be released in a timely manner. Because these libraries are built to work together, so more use AndroidX library helps minimize unexpected applications.

From the start of development work started on the use of Jetpack library can save hundreds of hours of time, but we can also migrate existing applications to Jetpack gallery above. Although it looks a lot of trouble, but because these libraries are very popular for migration guide is also very easy to find. At least, the bottom element Android (view, fragments, etc.) can be automatically converted.

In Candyspace, we use the Data Binding and ViewModel, and may soon join Room and Navigation.

3. The modular design

All along, the applications have been built as a huge "application" module, which contains everything needed for the entire application. Although this does allow them to share resources more easily, but it also means that some parts of the application can not be reused for other applications / open source projects; more important is the need to recompile the entire code base when making changes to the application.

Conversely, if the application by a number of smaller modules, you can simply recompile the code to make changes, thus greatly reducing the time to build. In addition, the modular design also for advanced Android characteristics (such as instant application - users do not need to install anything to use some of the features of your application, and dynamic characteristics - each part of the application installed on demand) applications opens the door.

To an existing application into multiple modules could be a very complex task, because it will thus uncover hidden problems before ( "DateUtility what it is why every class needs it?!?"); But Once the transformation is complete, the code base will enter a more healthy state. In addition, if a new application needs similar functionality, it can quickly reuse existing modules, thus saving time!

An example of modular application architecture (Source: The author created)

While designing a modular architecture can be complex task, but I have already written some guiding principles that inspired Nikits Kozlov has been constructed on a modular and time of the article. Plaid also wrote to share their experience of migration to the modular design of the article.

In Candyspace, our applications are completely modular design, in order to minimize the impact on build times interrupted development work.

4. App Bundle

With a traditional APK application will be distributed to the user's equipment, all the resources ready for all the equipment must be installed. This means that each bitmap image may have five copies (for different screen accuracy), but also to install multiple versions of libraries for different device architectures, and even had to install sets of margins and padding values.

When you distribute an application using the App Bundle, download the APK they contain resources actually required only. As a result, the average size of the application will be reduced by 20%, while the non-optimized application after application format change will be more significant size reduction.

Reduce the size of the sample application (Data from Google I / O 2018)

App Bundles are just born 18 months ago, but has used this format to install more than 25% of the applications! This is the format Google recommended, and most applications will be able to use this format almost without changes, just deal with what App Bundle signature can be on the Play Store.

In Candyspace, we are migrating to the App Bundles, while trying to avoid the destruction of our existing work processes (Slack, QAing building, installation of non-Google Play). Alistair Sykes article is a great migration of reference, the article takes into account the CI server, Slack and internal Google Play application sharing and other matters.

5. Test

Yes, test. Of course, the test is not a shiny new features, nor is it what the user can see, but want to ensure the reliability of the application of a certain existing user base, it is necessary to thoroughly test your application for the job. Since the collapse of the rate will directly affect your Play store ratings (and certainly drag score!), So you should try to keep it at a low level.

Test pyramid (Source: developer.android.com)

Android's three most common types of tests are (in descending order):

  • Unit testing, for example: I square root function returns the square root of it?

These tests will constitute the majority of the contents of your testing process, they are used to ensure that a particular piece of code (such as a function) can function as expected. When you build confidence in a component, you can use it for ...

  • Integration Testing. For example: My math module can work with the module position do?

These tests ensure that your respective area codes (modules or layers) can work properly. Knowing the components can communicate with each other properly applied, you can add ...

  • UI test automation, for example: user can mark a position yet on the application?

These tests will only run on a device or emulator, they can ensure that the application provides a complete user experience as expected. These tests are usually much slower than other types of tests (and running more inconvenient).

Google will recommend the distribution of a given test is 70% of the unit testing, integration testing 20% ​​and 10% of large-scale test, accounted for a relatively small part of the need for longer execution time, maintenance time and implementation time.

The best test resource is the official document, as it provides all test types are described, and how to implement the tutorial to the project.

In Candyspace, we will focus on unit testing, which accounted for a greater proportion than Google proposed to ensure that all new classes of behavior is predictable. We are currently in an improved automatic UI testing, to reduce reliance on manual testing.

In any field of programming, it will be about the best way to solve the problem there are a hundred different opinions; but Android has an absolute advantage: Android has a large community of developers, which means a very good new technology in rapidly developing who popularized. Possibility when you ask for help to strangers on the Internet, if you are looking for "Jetpack LiveData" rather than "before copying developer Web developer from a friend and convert the library", the answer would have been greater successful much more!

Maintain a healthy code base key is the ability to adapt to these changing standards and reconstruction of existing projects.


In this I also share a big brother himself included finishing the Android architecture study PDF + Video + Interview + document source notes , as well as advanced technical architecture Advanced Brain Mapping, Android interview with thematic development, senior advanced information architecture these are my leisure boutique will be repeated read data. In the mind map, each point is equipped with a knowledge of the topic corresponding to the actual project, can effectively help you grasp the knowledge points.

In short we are also here to help enhance learning advanced, but also saves you the time to learn online search data can also be shared with close friends studying together

If you have a need, you can point like + comment , concern me , plus Vx: 15388039515 (Note CSDN, need more advanced data)

Published 200 original articles · won praise 83 · views 70000 +

Guess you like

Origin blog.csdn.net/weixin_45258969/article/details/104436661