Open in app

Sign In

Write

Sign In

Chao Zhang
Chao Zhang

106 Followers

Home

Lists

About

Dec 20, 2021

Reduce, Reuse & Recycle your thread pools ♻️

Real-world applications today are mostly multi-threaded. This means developers should be mindful of managing the concurrency of their applications. Mastering the threading can help boost an app’s performance. On the other hand, using concurrency without fully understanding it could lead to problems that negatively impact the app’s health. For Android…

Android

9 min read

Reduce, Reuse & Recycle your thread pools ♻️
Reduce, Reuse & Recycle your thread pools ♻️
Android

9 min read


Published in Microsoft Mobile Engineering

·Nov 23, 2021

Reducing Android app size in practice at LinkedIn

App size is a key metric impacting user acquisition and retention: If the app is too large to download, users may skip installation or cancel the installation during downloading; if the app takes too much storage space after use, users may choose to uninstall. There are also different measurements of…

Android

7 min read

Reducing Android app size in practice at LinkedIn
Reducing Android app size in practice at LinkedIn
Android

7 min read


Nov 9, 2021

Fairly evaluating the impact of different Android UI libraries on Gradle build

For an Android application maintained by a large group of developers, build time is one of the most critical developer ergonomic metrics. This is particularly true when we evaluate to adopt new technology. Jetpack Compose is the new exciting modern UI library to build Android applications. Its official documentation already…

Gradle

9 min read

Fairly evaluating the impact of different Android UI libraries on Gradle build
Fairly evaluating the impact of different Android UI libraries on Gradle build
Gradle

9 min read


Sep 2, 2021

Safely collecting hot flows from Android native UI

Along with the coroutine adoption, StateFlowbecomes an alternative observable data holder for LiveDatasince StateFlowhas almost all the functionalities of LiveDatawithout the main thread confinment. On top of following the best practice of the safer way to collect flows from Android UI, this story covers another common pitfall in detail. Setup I…

Android

3 min read

Safely collecting hot flows from Android native UI
Safely collecting hot flows from Android native UI
Android

3 min read


Jun 23, 2021

Converting LiveData to Flow: More lessons learned

Android KTX provides opinionated methods facilitating using Kotlin Coroutines in Android Architecture Components. For instance, Flow<T>.asLiveData() is quite helpful to migrate your apps using LiveData towards coroutine. Make sure to understand their behaviors underneath before using them! This story is a continuation of the previous one. Lesson III: Unfinished coroutines during unit tests When converting from…

Kotlin

3 min read

Converting LiveData to Flow: More lessons learned
Converting LiveData to Flow: More lessons learned
Kotlin

3 min read


Apr 8, 2021

Debugging LiveData changes made easy

Have you ever got frustrated to debug LiveData changes by adding numerous log statements or breakpoints? As the core data structure of Android Architecture Components, LiveData is used widely in many apps to hold observable data. However, its debugging experience could still be a pain point after these many years. Observing LiveData changes at scale …

Livedata

7 min read

Debugging LiveData changes made easy
Debugging LiveData changes made easy
Livedata

7 min read


Apr 3, 2021

Converting LiveData to Flow: Lessons learned

Android KTX provides opinionated methods, such asFlow<T>.asLiveData(), facilitating using Kotlin Coroutines in Android Architecture Components. Make sure to understand their behaviors underneath before using them! The official documentation on Kotlin coroutines on Android is quitewell-written, while there are numerous article posts covering the basics. In this story, we will focus…

Android

3 min read

Converting LiveData to Flow: Lessons learned
Converting LiveData to Flow: Lessons learned
Android

3 min read


Feb 23, 2021

JvmSuppressWildcards: The secret sauce to your sandwich-style generics

If generic types are exposed in Kotlin API, consider @JvmSuppressWildcards so that your Java consumer can compile successfully. Kotlin generics are different from (in my opinion, smarter than) Java generics. Kotlin generics has declaration-site variance and type projections, which are officially documented here. Generics is a gigantic topic itself. …

Kotlin

3 min read

JvmSuppressWildcards: The secret sauce to your sandwich-style generics
JvmSuppressWildcards: The secret sauce to your sandwich-style generics
Kotlin

3 min read


Jan 29, 2021

Presenting data efficiently in emails

A simple trick to write an email report for your readers Recently my team wrote an email report to the leadership team on the executive summary of Android Gradle Plugin upgrades. Below is the initial version of the reports in the exec summary section: - We have migrated to Android…

Email

2 min read

Presenting data efficiently in emails
Presenting data efficiently in emails
Email

2 min read


Jan 2, 2021

Unraveling MockK’s black magic

This article is an English version of the blog. All credits belong to oboenikui. MockK is a mocking library written in Kotlin and for Kotlin. In addition to the traditional functionality provided by JVM based mocking libraries, Kotlin’s language feature significantly improves MockK’s usability. However, aside from MockK, have you…

Kotlin

8 min read

Unraveling MockK’s black magic
Unraveling MockK’s black magic
Kotlin

8 min read

Chao Zhang

Chao Zhang

106 Followers

Android Developer@Instacart

Following
  • Pen Magnet

    Pen Magnet

  • Elye

    Elye

  • The Android Developer

    The Android Developer

  • Morten Krogh-Jespersen

    Morten Krogh-Jespersen

  • Jaewoong Eum

    Jaewoong Eum

See all (68)

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Text to speech