How Java HashMap Works Internally

HashMap is one of the most frequently asked topics in Java interviews — it effectively tests a candidate’s understanding of data structures and engineering trade-offs. This article breaks down its core design and implementation details. ...

December 27, 2014 · 5 min · haoxiqiang

CSS Box Shadows Techniques

The box-shadow property in CSS3 is highly versatile. When used creatively, it can produce rich visual effects with pure CSS. Here are several practical techniques. ...

December 26, 2014 · 3 min · haoxiqiang

Android EBUSY Exception

While working on an image upload feature, I encountered a runtime exception on certain devices: 1 2 3 4 5 6 7 8 9 java.io.FileNotFoundException: /mnt/sdcard/Android/data/com.xxxxxx.android/files/xxxx open failed: EBUSY (Device or resource busy) at libcore.io.IoBridge.open(IoBridge.java:406) at java.io.FileOutputStream.<init>(FileOutputStream.java:88) ... Caused by: libcore.io.ErrnoException: open failed: EBUSY (Device or resource busy) at libcore.io.Posix.open(Native Method) at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110) ... ...

December 22, 2014 · 2 min · haoxiqiang

Tencent Interview

I came across stormzhang’s Tencent interview questions and decided to work through them, documenting my answers and thought process. Topics covered: Android fundamentals (processes, Activities, Handler) Screen density and resource qualifiers Thread synchronization in Java System design (resumable downloads, network architecture) ...

December 8, 2014 · 3 min · haoxiqiang

Lambda Expressions in Java 8

What is a Lambda Expression? Lambda expressions are a core feature introduced in Java 8, enabling more concise code. Here is the most straightforward example: 1 2 3 4 5 6 7 8 9 10 Runnable runnable1 = new Runnable() { @Override public void run() { System.out.println("runnable1 start!!!"); } }; Runnable runnable2 = () -> System.out.println("runnable2 start!!!"); runnable1.run(); runnable2.run(); Both blocks are equivalent, but the lambda version is a single line. The basic form is () -> expression or () -> { statements; }. ...

December 7, 2014 · 3 min · haoxiqiang

Wireless Debugging on Android

Ever since getting a Nexus device, I never wanted to plug in a USB cable again. Android supports ADB debugging over WiFi, making cable-free development a reality. ...

December 5, 2014 · 2 min · haoxiqiang

Android's SQLite

SQLite is a lightweight relational database engine built into Android, ideal for local data persistence. The android.database.sqlite package provides everything you need without additional setup. ...

December 1, 2014 · 2 min · haoxiqiang

Android's Palette

The Palette library, part of Android Support Library (now migrated to AndroidX palette), extracts representative colors from a Bitmap. In Material Design, deriving UI colors from imagery is a common pattern, and Palette makes this straightforward. ...

November 3, 2014 · 3 min · haoxiqiang

Android RecyclerView (Part 2): Parallax Scrolling

Parallax scrolling is a common UI effect where different layers move at different speeds during scrolling, creating a sense of depth. ...

November 2, 2014 · 2 min · haoxiqiang

Android RecyclerView

RecyclerView is a more flexible replacement for ListView. According to the official documentation, it efficiently maintains a limited collection of scrolling data items, and is recommended when your Views need to interact with user gestures and network data. ...

November 1, 2014 · 2 min · haoxiqiang