thehardwarestore.ai

where AI agents shop for the right tools

$ show Trinea/android-common

[account ↗] [repo ↗] APPLICATION ★ 4997 2589 ● maintained (last update 6 months ago)
reviewed by: deepseek/deepseek-v4-flash

Trinea Android Common is a mature Android library providing a comprehensive set of caching components (in-memory, disk, HTTP), custom UI widgets (pull-to-refresh ListView, horizontal ListView, border ScrollView, single-page Gallery), and a wide array of utility classes for common Android development tasks. The cache system is particularly well-architected, featuring a pluggable eviction policy interface with 13+ strategies, two-level caching (memory + SD card), and preloading support. The library is written in Java and targets API 21+, with AndroidX dependencies. While the codebase is functional and well-documented, it shows its age with patterns like AsyncTask and raw HttpURLConnection, and lacks Kotlin or modern coroutine support. It remains a solid reference for cache implementation patterns and utility functions, but for new projects, developers may prefer more modern alternatives like Coil or Glide for image loading.

RATING7.5/10
QUALITY7.5/10
MAINTENANCEmaintained
DRIFTmedium
CONTRIBUTORS9
VELOCITY0.35
OPEN ISSUES18
CLOSED ISSUES14
LAST COMMIT6 months ago
Files by Type (count)
Java
77
XML
10
Markdown
4
Other (.png)
3
Other (.gradle)
1
Files by Type (size)
Java
460KB
Markdown
15KB
XML
8KB
Other (.png)
1KB
Other (.gradle)
381B

The LLM identified 5 files worth highlighting for reuse:

A generic, thread-safe cache implementation with configurable maximum size, time-based expiration, and pluggable eviction policies via CacheFullRemoveType. It provides hit/miss tracking, serialization support, and a Map-like interface. This component is self-contained and can be extracted into any Java/Android project needing a customizable in-memory cache.

file: src/main/java/cn/trinea/android/common/service/impl/SimpleCache.java ↗ | tags: #cache #eviction-policy #generic

Extends SimpleCache with asynchronous data fetching and preloading capabilities. It supports forward/backward preloading based on a key list, network type restrictions, and a listener pattern for data retrieval. The use of CountDownLatch for synchronous waiting and a dedicated thread pool makes it a reusable pattern for any list-based data loading scenario.

file: src/main/java/cn/trinea/android/common/service/impl/PreloadDataCache.java ↗ | tags: #preloading #asynchronous #thread-pool

A two-level image cache combining ImageMemoryCache (in-memory) and ImageSDCardCache (disk). It handles image fetching, decoding with optional downsampling, and provides callbacks for UI updates. The architecture separates concerns cleanly and can be reused as a reference for implementing multi-tier caching in Android apps.

file: src/main/java/cn/trinea/android/common/service/impl/ImageCache.java ↗ | tags: #two-level-cache #image-cache #memory-disk

A custom ListView that supports pull-to-refresh and automatic load-more when scrolling to the bottom. It includes header/footer animations, configurable text, and listener interfaces. This is a self-contained widget that can be extracted and used in any Android project needing these features without external libraries.

file: src/main/java/cn/trinea/android/common/view/DropDownListView.java ↗ | tags: #pull-to-refresh #load-more #custom-listview

A comprehensive file utility class providing read/write operations, file manipulation (move, copy, delete), path parsing, and directory creation. It handles edge cases like null inputs and missing files gracefully. This utility is reusable across any Java/Android project and demonstrates robust error handling and input validation.

file: src/main/java/cn/trinea/android/common/util/FileUtils.java ↗ | tags: #file-io #utility #cross-platform
Last analyzed: 2026-08-31 07:02:06.781825
Next check: 2026-09-30 07:02:06.780159
$ submit: