Android Technical Weekly: 38 Technical Articles

Every Monday or Tuesday, we will send out a technical collection. This week marks the first issue, and we will no longer divide it by date. Let’s see how long we can keep this up.

The articles are selected from those shared weekly by everyone on WanAndroid.

WeChat restricts external link clicks, you can click to read the original text and support external link viewing.

[1] Using the CPU Profiler in Android Studio to Lock Down UI Stuttering: There are many reasons for stuttering, such as stuttering caused by the application or by SurfaceFlinger. This article focuses on stuttering caused by the application, and the tools provided by Android Studio to discover and eliminate this stuttering, by checking the recorded traces during application interaction to solve performance issues.

[2] Parcelable – A Proud Creation of the Google Team – Juejin: Parcelable is a serialization class specifically designed by the Google team for Android. Since Java already has Serializable serialization, why do we still need Parcelable? We will compare the differences between them by reading the implementation class and source code of Parcelable.[3] Android Interview Questions: Why Does ViewModel Exist Even After Activity Rebuilds? — Jetpack Series (3) – Juejin: In this article, I will discuss with you the practical use of ViewModel and common knowledge points in interviews.[4] UI Adaptation Plan for All Models on Vivo Official APP – Juejin: The increasing number of models has brought a lot of adaptation work for developers. Issues like whether the code can be unified, whether the APK can be unified, how to select materials, and how to display styles are all concerns for developers. This plan introduces a common line solution for different models to alleviate developers’ doubts.

[5] Reflection Techniques to Boost Your Performance Several Times – Juejin: In a previous article, I mentioned an important point for performance improvement, setting Accessible to true will further enhance reflection speed. If you look at a single program, this performance gain may seem insignificant, but in a large and complex project running on many low-end machines, the performance improvement from a single line of code may be more significant than writing 100 lines of code.[6] Mobile Page Instant Opening Optimization Summary: App optimization is a topic that cannot be avoided in work, interviews, or KPIs. How can we make user experience smooth? Today, I summarize the optimizations I have made in the past two months at work. I am still a novice in optimization, and I hope you can point out any mistakes. This article mainly discusses the improvement of the instant opening rate when transitioning from Native to Flutter interface.

[7] Following the Latest Android Architecture to Create a Perfect Android App: I have seen many open-source clients of WanAndroid that do not pay much attention to UI. However, if it is an app for daily use, I believe that without a decent UI, there will be little motivation to use it. Material Design is undoubtedly the best choice, and the business architecture strictly follows Android Architecture Components.[8] Learn Bytecode Replacement in One Go to Assist Privacy Compliance Review: With the increasing strictness of privacy compliance across platforms, it has become more difficult to launch apps. Major SDKs have feedback and solutions, but many third-party library authors have stopped maintaining them, which is frustrating. How can we solve this situation?

[9] Exploring ARM Unwind Technology on the Android Platform – Zhihu: For an engineer, being familiar with how to print the calling stack is a basic skill. The most direct way to know which function called another is by printing the calling stack. This article mainly lists the C/C++ stack unwind methods on the Android platform and some of their internal principles. Additionally, understanding the implementation principles of stack unwind can help better customize and optimize debugging tools, which is worth exploring.

[10] Android System Architecture and Related Module Description: The architecture of Android is layered, very clear, and has well-defined divisions of labor. Android itself is a software stack, or “software layering architecture,” mainly divided into three layers: operating system, middleware, and applications. The Android system is divided into four layers.[11] 2022 Android Interview Experience, After One and a Half Months, Secured a Major Company Offer

[12] Android 13 is Here, Quick! Help Me Up!: Let’s take a look at what updates Android 13 has and how developers should adapt.[13] After Learning ASM Tree API, I Am No Longer Afraid of Hooking – Juejin: After reading this chapter, you will learn how to use ASM’s tree API for hooking anonymous threads, and you will also understand the related operations and background knowledge of ASM! Many people may be familiar with ASM instrumentation, but most may only be familiar with the core API. Many of the instrumentation libraries on the market are actually written using the tree API, as its simplicity and clarity have made it the choice for many open-source libraries.

[14] Interview Questions | What Are the Methods to Wait for Multiple Concurrent Results? – Juejin: This article will introduce several solutions and apply them to different business scenarios, comparing which solution is suitable for which scenario.

[15] Android Componentized Development (Part Four) – Encapsulation of Process Survival Component – Juejin: In previous articles, we encapsulated the network request component lib_network and the image loading component lib_image_loader. Today we will encapsulate a process survival component lib_pull_alive.[16] Macrobenchmark Usage Baseline Profile Hot Code Collection: This article mainly records the system-level startup optimization for Android startup optimization scheme research. In this article, using the Baseline profile for system-level optimization can be divided into the following stages.

[17] Is There Still a Need to Learn LiveData? — Jetpack Series (2): Although LiveData is no longer the component promoted by Google, considering that LiveData still exists in a large amount of legacy code, and the issues and solutions that have arisen with the development of the Android ecosystem, I believe LiveData still has its significance.[18] Exploring the Principles of ANR – Who Controls the Trigger Time of ANR: ANR (Application Not Responding) refers to when an application does not respond. The Android system requires that certain events be completed within a specific time frame. If it fails to respond effectively or the response time is too long, it will cause ANR.

[19] In-depth Understanding of MMAP Principles: Why do major companies prefer components like WeChat’s MMKV, Meituan’s Logan component, and WeChat’s logging module xlog? What is their magic?

[20] Wrote a Small Plugin for Adapting Android 12-exported: The adaptation for Android 12, specifically regarding the exported part, is relatively simple and practical, but there are version differences that need to be adjusted for real use. This article is about the improvements made for this and has been abstracted into a small plugin for better reuse.[21] Android Development is Too Difficult, Everything About Native Crash!: Native Crash has always been a pain for major apps. This article is very in-depth and is an internal sharing from Xiaomi’s Chen Guanyu, selflessly shared with everyone. There is very little information available online about Native Crash analysis, and it is not easy to find someone who is proficient in it. Due to the depth of knowledge, it may be very difficult to understand, but this article is definitely worth keeping for frequent review.

[22] Principles and Practices of Huolala Android Dynamic Resource Management System (Part Two): During the process of packaging so resources, we encountered the following problems: how to remove so files from the APK and collect them? How to compress and package multiple so files and generate corresponding information? How to ensure that third-party SDKs do not crash when they lack so files?[23] How to Clearly Understand the Execution Status of Background Tasks in Android Applications?: In Android Studio Arctic Fox, we released a new inspector (Background Task Inspector) to help you monitor and debug Workers scheduled using WorkManager 2.5.0 or higher in your application.

[24] Activity.onStop() Delayed by 10 Seconds? Detect, Locate, and Fix It! – Juejin: After a certain version of the online app, the server team discovered a strange phenomenon from the buried point data: “After the Activity.onPause() of all interfaces, it takes exactly 10 seconds to call back Activity.onStop().”

[25] Principles of Kotlin Suspended Functions: Kotlin suspended functions are used frequently in learning and work, and it is very necessary to understand their principles. This article will guide you step by step through their implementation.

[26] Detailed Explanation of Linux Ptrace – The Stubborn Stone’s Blog_linux ptrace: The ptrace() system call provides a way for a process (the “tracer”) to monitor and control another process (the “tracee”). It can check and change the data in the “tracee” process’s memory and registers. It can be used for breakpoint debugging and system call tracing.

[27] Considerations for Mobile App Disaster Recovery: Many people may be unfamiliar with this concept. When we talk about disaster recovery strategies, we usually refer to server-side disaster recovery. But what about mobile disaster recovery? It’s actually similar to servers, which is to continuously ensure the availability of our app, and to implement measures to maintain usability in the event of a crash or ANR.

[28] Lifecycle: The Basics of Lifecycle-Aware Components — Jetpack Series (1): Lifecycle is the foundation of several Jetpack components, such as LiveData, which is a lifecycle-aware data container based on Lifecycle. Therefore, we choose to place Lifecycle in the first article of the Jetpack series.

[29] Why is Gradle an Indispensable Hurdle for Advanced Android Development?: Gradle, as the officially promoted build system, is now deeply applied in many technical systems of Android, such as componentized development, product building, unit testing, etc. It can be seen that to become a senior Android engineer, mastering Gradle is essential. In this article, I will guide you to build a basic concept of Gradle from shallow to deep, covering Gradle lifecycle, Project, Task, and other knowledge points, which are also commonly encountered in Gradle interview questions.

[30] Understand Android Signatures v1, v2, v3, v4 in One Go, Why Is It All v4 Now?: Recently, I helped testing with some signature requirements, and today I will briefly discuss the matters regarding signatures with you.

[31] Using Android Notifications: In application development, we will inevitably encounter application notifications, and notifications change with Android versions. To use them in both high and low versions, developers need to adapt, which is also part of filling in the gaps.[32] Binder Principle Analysis – Juejin: In regular development, we inevitably encounter inter-process communication. When we use system services such as ActivityServiceManager, we are actually using inter-process calls, which require solving the communication issues between processes. The Android system provides us with the Binder mechanism, allowing us to freely implement inter-process communication. Let’s take a look at the principles related to the Binder mechanism.

[33] Flutter Drawing Exploration | Let’s Draw Arrows Together – Juejin: Some may wonder what is so special about drawing arrows; isn’t it just a line with two ends? In fact, drawing arrows is quite complex and involves many drawing techniques.[34] Essential Process Knowledge You Must Know – Juejin: In today’s thread-oriented computer architecture, a process is a container for threads. A program is a description of instructions, data, and their organization, while a process is the entity of a program. The official explanation is understandable without being overly simplistic. In programmers’ terms, a program is a class, and a process is an object.

[35] Summary of Android Multi-Channel Packaging Solutions – Juejin: From the perspective of open-source maintenance, the packer-ng-plugin project has stopped maintenance, Walle’s last maintenance was two years ago, and VasDolly’s last maintenance was five months ago. From the perspective of open-source maintenance, Tencent’s VasDolly solution is superior.

[36] Detailed Explanation of Android Performance Optimization APK Slimming (73% Slimming) – Juejin: Given the current rapid development situation, our app was already 87.1MB before optimization, which was too large, and operations said that this conversion rate was not high, so we had to optimize it. After optimization, the package size was reduced to 23.1MB (a 73% reduction, don’t call me a clickbaiter).

[37] Activity Interaction Issues, Are You Sure You Know Them All? – Juejin: For Android developers, activities are like first loves; they have low startup requirements, respond quickly, and can be played with many tricks if prepared properly. However, there may be many potential issues regarding activity interaction, and this article will explore common limitations of Binder data transfer, the impact of multiple applications on activity transitions, and more.

[38] Android OpenGL Development – Detailed Explanation of EGL – Juejin: Most developers may have used OpenGL but are unaware of what EGL is or its role. This is not surprising, as Android’s GlSurfaceView has already configured the EGL environment for you. You have been using it without knowing about its existence.

Friendly Reminder: WeChat restricts external link clicks, you can click to read the original text and support external link viewing.

Reference Links

[1] Using the CPU Profiler in Android Studio to Lock Down UI Stuttering https://mp.weixin.qq.com/s/IWVxQEOv3pS5a9K4YjlUiQ [2] Parcelable – A Proud Creation of the Google Team – Juejin https://juejin.cn/post/7016631342368555044 [3] Android Interview Questions: Why Does ViewModel Exist Even After Activity Rebuilds? — Jetpack Series (3) – Juejin https://juejin.cn/post/7121998366103306254 [4] UI Adaptation Plan for All Models on Vivo Official APP – Juejin https://juejin.cn/post/7121888135599882254 [5] Reflection Techniques to Boost Your Performance Several Times – Juejin https://juejin.cn/post/7121901090332737572 [6] Mobile Page Instant Opening Optimization Summary https://juejin.cn/post/7121636526596816933 [7] Following the Latest Android Architecture to Create a Perfect Android App https://mp.weixin.qq.com/s/ZHIZU_b3ulWd2LvN0W2lqg [8] Learn Bytecode Replacement in One Go to Assist Privacy Compliance Review https://juejin.cn/post/7121985493445083149

[9] Exploring ARM Unwind Technology on the Android Platform – Zhihu

https://zhuanlan.zhihu.com/p/336916116 [10] Android System Architecture and Related Module Description https://juejin.cn/post/7119763605620260894

[11] 2022 Android Interview Experience, After One and a Half Months, Secured a Major Company Offer https://mp.weixin.qq.com/s/rwcPQNUpdPYmeL-JfA4eJg [12] Android 13 is Here, Quick! Help Me Up! https://mp.weixin.qq.com/s/vP5DXc3wutM8bFt7EgQrXQ [13] After Learning ASM Tree API, I Am No Longer Afraid of Hooking – Juejin https://juejin.cn/post/7121643784638562317 [14] Interview Questions | What Are the Methods to Wait for Multiple Concurrent Results? – Juejin https://juejin.cn/post/7121517604644061192 [15] Android Componentized Development (Part Four) – Encapsulation of Process Survival Component – Juejin https://juejin.cn/post/7121643256495996936 [16] Macrobenchmark Usage Baseline Profile Hot Code Collection https://juejin.cn/post/7121624699565506574 [17] Is There Still a Need to Learn LiveData? — Jetpack Series (2) https://juejin.cn/post/7121621553670225957 [18] Exploring the Principles of ANR – Who Controls the Trigger Time of ANR https://juejin.cn/post/7121217696594657293 [19] In-depth Understanding of MMAP Principles https://juejin.cn/post/7119116943256190990

[20] Wrote a Small Plugin for Adapting Android 12-exported https://mp.weixin.qq.com/s/o0hvqCuogrdwF8Webu3NhA [21] Android Development is Too Difficult, Everything About Native Crash! https://mp.weixin.qq.com/s/YDhqP_ZkSVDRX8CSxQrUA [22] Principles and Practices of Huolala Android Dynamic Resource Management System (Part Two) https://mp.weixin.qq.com/s/DG-ttWIWV0vKOs5987rbLA [23] How to Clearly Understand the Execution Status of Background Tasks in Android Applications? https://mp.weixin.qq.com/s/0mABDGX4gcbXEU93RugP-w [24] Activity.onStop() Delayed by 10 Seconds? Detect, Locate, and Fix It! – Juejin https://juejin.cn/post/7118901913793331207 [25] Principles of Kotlin Suspended Functions https://mp.weixin.qq.com/s/70wBBKwFFLb0X_zrsvNzDA [26] Detailed Explanation of Linux Ptrace – The Stubborn Stone’s Blog_linux ptrace https://blog.csdn.net/u012417380/article/details/60470075 [27] Considerations for Mobile App Disaster Recovery https://juejin.cn/post/7120802538332372999 [28] Lifecycle: The Basics of Lifecycle-Aware Components — Jetpack Series (1) https://juejin.cn/post/7120472134853328909 [29] Why is Gradle an Indispensable Hurdle for Advanced Android Development? https://mp.weixin.qq.com/s/h4t91VB2K1AICVMn5MnPDg

[30] Understand Android Signatures v1, v2, v3, v4 in One Go, Why Is It All v4 Now? https://mp.weixin.qq.com/s/V28wEeVfaY7lMZCvl5FtmQ [31] Using Android Notifications https://mp.weixin.qq.com/s/ALY3BxRO1fb_F4Ol5t7Uig [32] Binder Principle Analysis – Juejin https://juejin.cn/post/7120039919501705253 [33] Flutter Drawing Exploration | Let’s Draw Arrows Together – Juejin https://juejin.cn/post/7120010916602576926 [34] Essential Process Knowledge You Must Know – Juejin https://juejin.cn/post/7119117491330088967 [35] Summary of Android Multi-Channel Packaging Solutions – Juejin https://juejin.cn/post/7119409569670889509 [36] Detailed Explanation of Android Performance Optimization APK Slimming (73% Slimming) – Juejin https://juejin.cn/post/7119445311868633096 [37] Activity Interaction Issues, Are You Sure You Know Them All? – Juejin https://juejin.cn/post/7119465581232783397 [38] Android OpenGL Development – Detailed Explanation of EGL – Juejin https://juejin.cn/post/7119673311792988168

Recommended Reading

Why Are So Many Fragment APIs Deprecated?

Android Implementation of Menu Drag and Drop Sorting, So Easy

Huolala Android H5 Offline Package Principles and Practices

Click to Follow My Public Account

If you want to share your articles with everyone, feel free to submit~

┏(^0^)┛See you tomorrow!

Leave a Comment

×