A, affinity,
To be honest, WHEN I first brushed the questions, I typed LeetCode, and then I noticed the existence of finger offer, which I heard from others at the beginning. Finger offer is very likely to appear in the interview process, so I tried to do all of them, and found in the process, In fact, some topics overlap with LeetCode, but they are more like a collection of classic topics of LeetCode, which is more representative.
At the beginning, I was not impressed by the offer after brushing it once. It was not until I participated in the autumn recruitment interview in 2020 that I was deeply aware of the frequent occurrence of the offer questions. From then on, WHENEVER anyone asked me how to brush the offer questions, I would recommend to brush the offer first. Then I brushed the first 200 questions of LeetCode, and now there is an officially authorized sword offer topic in Liko, which is really exciting. Combined with the excellent experience of the platform, I believe that more people will know about sword offer. Now I will talk about why I like it so much based on the interview.
1. Kotlin
-
Kotlin, often seen as the next Java, is sponsored by Google and JetBrains, the Android Studio developer. Java has been the development language of choice for Android apps from the beginning, but Kotlin has exploded in popularity in recent years and is now used by nearly 60% of 10,000 Google Play apps [3]. C++ will continue to be used in the rare cases where access to underlying native code is required; But Kotlin can replace Java in all other cases.
-
Kotlin’s main advantage is full interoperability with Java, which means developers can migrate as much older code as possible without completely rewriting the entire application. The two languages are so compatible that Android Studio can even automatically convert from Java to Kotlin.
-
This compatibility, along with a cleaner syntax and hundreds of minor improvements, makes Kotlin the fourth “most popular” and fifth “wanted” programming language in StackOverflow’s 2019 Developer Survey [4], and the highest ranking of all mobile programming languages.
-
A good way to migrate an existing application is to convert an existing Java file to Kotlin when it is modified. Although this means that you have to transfer frequently edited files, which can increase the complexity of code review (such as potential conflicts), because the transformed areas are reviewed, you can ensure that any problems are found.
-
86% (and growing) of Kotlin code is currently used in Candyspace, while the remaining 14% is utility/conversion code that hasn’t changed in years.
2. Jetpack
Google’s AndroidX/Jetpack library is a set of utilities designed to simplify common application requirements. Examples include Room[5] for the database on the device, or LiveData[6] for updating the display when the underlying data changes.
With the Jetpack library, new projects don’t have to reinvent the wheel or wait for other developers to open source their implementations, and now the basics are available to every developer. These libraries are updated frequently, with new features and bug fixes being released. Since these libraries are built to work together, using the AndroidX libraries helps minimize surprises in your application.
Using the Jetpack library from the start of development can save hundreds of hours, but you can also migrate existing applications to the Jetpack library. Although it may seem cumbersome, because of the popularity of these libraries, guidance for migration efforts is easy to find. At a minimum, underlying Android elements (views, fragments, and so on) can be converted automatically [7].
In Candyspace, we used Data Binding and ViewModel, and will probably add Room and Navigation soon.
3. Modular design
-
Applications have always been built as one giant “application” module that contains everything needed for the entire application. While this does make it easier to share resources, it also means that parts of the application cannot be reused by other applications/open source projects; More importantly, the entire code base must be recompiled when changes are made to the application.
-
Conversely, if your application is made up of many smaller modules, you can simply recompile the code that made the changes, greatly reducing build time. In addition, the modular design opens the door to advanced Android features such as instant apps, where users can use parts of your app without having to install anything, and dynamic features, where parts of your app are installed on demand.
-
Breaking an existing app into modules can be a complex exercise, as it can lead to previously hidden issues (” What is DateUtility? Why does every class need it! ?” ); But once the transformation is complete, the code base moves into a healthier state. In addition, if a new application needs similar functionality, you can quickly reuse existing modules, saving a lot of time!
An example of a modular application architecture
While designing a modular architecture can be a complex task, I have previously written about some guiding principles [8] inspired by Nikits Kozlov’s article on modularity and build time [9]. Plaid also wrote an article on their experience migrating to modular design [10].
At Candyspace, our applications are designed to be completely modular to minimize the disruption of build times.
4. App Bundle
When using traditional APK to distribute applications to users’ devices, all resources for all devices must be installed. This means that you might have five copies of each bitmap image (for different screen precision), multiple library versions for different device architectures, and even multiple sets of margins and fillers.
When distributing an App using the App Bundle, the APK users download contains only the resources they actually need. As a result, the average app size is reduced by 20 percent, and unoptimized apps can be reduced even more dramatically by reformatting.
Example of reducing application size (source: Google I/O 2018)
App Bundles were only launched 18 months ago, but already more than 25% of apps are installed using this format! This is the format recommended by Google [11], and most apps can use this format with little change, simply by processing the App Bundle’s signature on the Play Store.
At Candyspace, we are migrating to App Bundles while trying to avoid breaking our existing workflows (Slack, QAing builds, non-Google Play installs). Alistair Sykes’ article is a great migration reference [12], taking into account things like CI servers, Slack, and app sharing within Google Play.
The end of the
Based on salary treatment, with development as the ultimate goal, to seek the best development in the place of high salary!
Here are some more advanced data compiled by a few Android industry heavyweights for the technical points above. Have **Android architecture video +BATJ interview topics PDF+ core notes and other materials. I hope I can help you improve your technology. If you want to get it, you can send me a private message [666] to get it for free