Build AOSP for Pixel 3 XL

The AOSP build process is fairly well understood by now: sync the source code, add device-specific drivers and kernel, and build the target image. I had built AOSP before to debug certain issues, but official support for Pixel 3 XL only goes up to Android 12. Recently, while working on Chromium development, I needed to test WebView on a newer platform, so I used LineageOS 21 for the build instead. ...

August 15, 2022 · 2 min · haoxiqiang

Optimizing Android Builds with Self-Hosted Nexus Repository

In Android dependency management, it’s common to configure multiple remote repositories like jcenter, jitpack, google(), and more. Some large projects, such as “Zuiyou”, depend on over 10 repositories. This becomes a significant problem during initial project setup, dependency changes, or network issues — troubleshooting builds becomes a nightmare. I had noticed this issue long ago but kept putting off addressing it. This post documents the Nexus setup process. Installing and Configuring Nexus Prerequisite: JDK 8+. ...

December 31, 2019 · 2 min · haoxiqiang

Android MediaStore: GROUP BY via ContentResolver

When building a photo album feature similar to WeChat, I needed to read photos and videos with multi-folder switching — and it had to be faster than WeChat. After some research, the MediaStore approach proved most suitable. Since I hadn’t used it much before, this post serves as a record. The GROUP BY Hack in ContentResolver ContentResolver.query() does not expose a groupBy parameter (unlike SQLiteQueryBuilder.query()), but you can achieve a similar effect by embedding GROUP BY directly into the selection argument. ...

March 31, 2017 · 2 min · haoxiqiang

Android Issues Roundup (Part 2)

Second batch of collected issues, mainly covering WebView memory management, cookie synchronization, and other development details. ...

January 19, 2016 · 3 min · haoxiqiang

Building an App with RxJava

I’ve been working on a Zhihu Daily client to evaluate RxJava’s benefits and trade-offs in a real project. RxJava has gained significant traction abroad, with language bindings spanning Java, JavaScript, C#, Scala, Clojure, C++, Python, Ruby, Kotlin, Swift, and more. ...

January 7, 2016 · 2 min · haoxiqiang

Android Development Issues and Solutions

After reading some issue roundups on Xiaoke’s Blog, I realized I’ve encountered many of the same problems. Here’s a collected summary. ...

December 29, 2015 · 5 min · haoxiqiang

Android Resource Shrinking

While building a project, I discovered the shrinkResources attribute, which removes unused resources from the APK. Here is how to configure it and what to watch out for. ...

December 23, 2015 · 2 min · haoxiqiang

Tree View Menu with RecyclerView

I had long wanted to write a tree view demo. Previously, I used TreeViewList (a ListView wrapper) or ExpandableListView for multi-level menus. Eventually I realized there is no need for custom views – just use RecyclerView and manage the data flattening yourself. The core idea: recursively flatten a nested data structure into a linear list, then use notifyItemRangeInserted / notifyItemRangeRemoved to handle expand and collapse. ...

December 16, 2015 · 3 min · haoxiqiang

Solving Problems from Error Logs — Bugly Blog Collection

We use Tencent Bugly for crash monitoring in our project. Most crash reporting tools are similar in functionality; Bugly was chosen for its clean statistics dashboard and reliable brand. Here is a curated collection of Bugly’s technical blog posts covering common crash scenarios and analysis approaches. ...

July 29, 2015 · 1 min · haoxiqiang

Common Issues When Customizing Volley

While integrating Volley into a project, I encountered several common issues worth documenting. The following does not apply to Android 2.3 and below. ...

June 9, 2015 · 1 min · haoxiqiang