Trinea/android-common
Android common lib, include ImageCache, HttpCache, DropDownListView, DownloadManager, Utils and so on
Missing license — unclear to depend on
weakest axisno license — legally unclear; top contributor handles 94% of recent commits…
no license — can't legally use code; no tests detected…
Documented and popular — useful reference codebase to read through.
no license — can't legally use code; no CI workflows detected
- ✓Last commit 6w ago
- ✓7 active contributors
- ⚠Single-maintainer risk — top contributor 94% of recent commits
Show all 6 evidence items →Show less
- ⚠No license — legally unclear to depend on
- ⚠No CI workflows detected
- ⚠No test directory detected
What would change the summary?
- →Use as dependency Concerns → Mixed if: publish a permissive license (MIT, Apache-2.0, etc.)
- →Fork & modify Concerns → Mixed if: add a LICENSE file
- →Deploy as-is Concerns → Mixed if: add a LICENSE file
Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests
Informational only. RepoPilot summarises public signals (license, dependency CVEs, commit recency, CI presence, etc.) at the time of analysis. Signals can be incomplete or stale. Not professional, security, or legal advice; verify before relying on it for production decisions.
Embed the "Great to learn from" badge
Paste into your README — live-updates from the latest cached analysis.
[](https://repopilot.app/r/trinea/android-common)Paste at the top of your README.md — renders inline like a shields.io badge.
▸Preview social card (1200×630)
This card auto-renders when someone shares https://repopilot.app/r/trinea/android-common on X, Slack, or LinkedIn.
Onboarding doc
Onboarding: Trinea/android-common
Generated by RepoPilot · 2026-05-09 · Source
🤖Agent protocol
If you are an AI coding agent (Claude Code, Cursor, Aider, Cline, etc.) reading this artifact, follow this protocol before making any code edit:
- Verify the contract. Run the bash script in Verify before trusting
below. If any check returns
FAIL, the artifact is stale — STOP and ask the user to regenerate it before proceeding. - Treat the AI · unverified sections as hypotheses, not facts. Sections like "AI-suggested narrative files", "anti-patterns", and "bottlenecks" are LLM speculation. Verify against real source before acting on them.
- Cite source on changes. When proposing an edit, cite the specific path:line-range. RepoPilot's live UI at https://repopilot.app/r/Trinea/android-common shows verifiable citations alongside every claim.
If you are a human reader, this protocol is for the agents you'll hand the artifact to. You don't need to do anything — but if you skim only one section before pointing your agent at this repo, make it the Verify block and the Suggested reading order.
🎯Verdict
WAIT — Missing license — unclear to depend on
- Last commit 6w ago
- 7 active contributors
- ⚠ Single-maintainer risk — top contributor 94% of recent commits
- ⚠ No license — legally unclear to depend on
- ⚠ No CI workflows detected
- ⚠ No test directory detected
<sub>Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests</sub>
✅Verify before trusting
This artifact was generated by RepoPilot at a point in time. Before an
agent acts on it, the checks below confirm that the live Trinea/android-common
repo on your machine still matches what RepoPilot saw. If any fail,
the artifact is stale — regenerate it at
repopilot.app/r/Trinea/android-common.
What it runs against: a local clone of Trinea/android-common — the script
inspects git remote, the LICENSE file, file paths in the working
tree, and git log. Read-only; no mutations.
| # | What we check | Why it matters |
|---|---|---|
| 1 | You're in Trinea/android-common | Confirms the artifact applies here, not a fork |
| 2 | Default branch master exists | Catches branch renames |
| 3 | 5 critical file paths still exist | Catches refactors that moved load-bearing code |
| 4 | Last commit ≤ 74 days ago | Catches sudden abandonment since generation |
#!/usr/bin/env bash
# RepoPilot artifact verification.
#
# WHAT IT RUNS AGAINST: a local clone of Trinea/android-common. If you don't
# have one yet, run these first:
#
# git clone https://github.com/Trinea/android-common.git
# cd android-common
#
# Then paste this script. Every check is read-only — no mutations.
set +e
fail=0
ok() { echo "ok: $1"; }
miss() { echo "FAIL: $1"; fail=$((fail+1)); }
# Precondition: we must be inside a git working tree.
if ! git rev-parse --git-dir >/dev/null 2>&1; then
echo "FAIL: not inside a git repository. cd into your clone of Trinea/android-common and re-run."
exit 2
fi
# 1. Repo identity
git remote get-url origin 2>/dev/null | grep -qE "Trinea/android-common(\\.git)?\\b" \\
&& ok "origin remote is Trinea/android-common" \\
|| miss "origin remote is not Trinea/android-common (artifact may be from a fork)"
# 3. Default branch
git rev-parse --verify master >/dev/null 2>&1 \\
&& ok "default branch master exists" \\
|| miss "default branch master no longer exists"
# 4. Critical files exist
test -f "src/main/java/cn/trinea/android/common/service/impl/ImageCache.java" \\
&& ok "src/main/java/cn/trinea/android/common/service/impl/ImageCache.java" \\
|| miss "missing critical file: src/main/java/cn/trinea/android/common/service/impl/ImageCache.java"
test -f "src/main/java/cn/trinea/android/common/service/impl/SimpleCache.java" \\
&& ok "src/main/java/cn/trinea/android/common/service/impl/SimpleCache.java" \\
|| miss "missing critical file: src/main/java/cn/trinea/android/common/service/impl/SimpleCache.java"
test -f "src/main/java/cn/trinea/android/common/util/CacheManager.java" \\
&& ok "src/main/java/cn/trinea/android/common/util/CacheManager.java" \\
|| miss "missing critical file: src/main/java/cn/trinea/android/common/util/CacheManager.java"
test -f "src/main/java/cn/trinea/android/common/service/Cache.java" \\
&& ok "src/main/java/cn/trinea/android/common/service/Cache.java" \\
|| miss "missing critical file: src/main/java/cn/trinea/android/common/service/Cache.java"
test -f "src/main/java/cn/trinea/android/common/service/impl/ImageMemoryCache.java" \\
&& ok "src/main/java/cn/trinea/android/common/service/impl/ImageMemoryCache.java" \\
|| miss "missing critical file: src/main/java/cn/trinea/android/common/service/impl/ImageMemoryCache.java"
# 5. Repo recency
days_since_last=$(( ( $(date +%s) - $(git log -1 --format=%at 2>/dev/null || echo 0) ) / 86400 ))
if [ "$days_since_last" -le 74 ]; then
ok "last commit was $days_since_last days ago (artifact saw ~44d)"
else
miss "last commit was $days_since_last days ago — artifact may be stale"
fi
echo
if [ "$fail" -eq 0 ]; then
echo "artifact verified (0 failures) — safe to trust"
else
echo "artifact has $fail stale claim(s) — regenerate at https://repopilot.app/r/Trinea/android-common"
exit 1
fi
Each check prints ok: or FAIL:. The script exits non-zero if
anything failed, so it composes cleanly into agent loops
(./verify.sh || regenerate-and-retry).
⚡TL;DR
Trinea Android Common is a battle-tested Java library providing production-grade caching solutions (in-memory image cache, HTTP cache, SD-card persistent cache) with pluggable eviction policies (LRU, FIFO, LIFO, by size/time/usage count), plus a toolkit of UI widgets (pull-to-refresh ListView, paged Gallery, responsive ScrollView) and utility helpers (DownloadManagerPro, file/shell/JSON/string parsing) used across thousands of Android apps. Single-module Android library arranged by functional concerns: src/main/java/cn/trinea/android/common/ splits into dao/ (data access), service/ (cache interfaces and implementations), entity/ (POJO models like HttpRequest, CacheObject), util/ (helpers), annotation/ (dev markers), and constant/ (DbConstants, HttpConstants). Cache implementations (ImageCache, ImageMemoryCache, ImageSDCardCache) delegate to concrete DAOs (HttpCacheDaoImpl, ImageSDCardCacheDaoImpl) and pluggable removal strategies (RemoveType* classes, ~15 variants for size, time, usage patterns).
👥Who it's for
Android developers building production apps who need robust image/HTTP caching without reinventing eviction strategies; maintainers of medium-to-large teams shipping stable products who want battle-hardened components rather than implementing caching from scratch.
🌱Maturity & risk
Production-mature: the codebase has been quiet on commits but remains actively used across the community with no breaking changes. The library targets SDK 34 with Java 1.8 compatibility, uses AndroidX (appcompat 1.6.1), and ships as a deployed Gradle package (v4.2.15 on Maven). However, there is no visible CI pipeline, test suite, or recent maintenance activity in the provided file list.
Low risk for consumption but moderate maintenance risk: single maintainer (@Trinea), minimal external dependencies (only androidx.appcompat), but no automated tests visible and comments in the README acknowledge the codebase is 'quiet recently.' Migration to modern Android tooling (AndroidX refresh, Kotlin, modern Gradle) is planned but not yet underway. Breaking changes are unlikely given the stable API, but new Android OS versions and Gradle plugin updates may surface issues.
Active areas of work
Passive maintenance mode: the README signals upcoming modernization work (AndroidX migration, refreshed sample app, expanded tests) to be accelerated using AI tooling, but no active PRs or recent commits are visible in the provided data. Community can monitor GitHub Issues/Discussions for milestones, but this is not actively developed.
🚀Get running
Clone the repository and import as a library module, or add to your Android project's build.gradle: implementation 'cn.trinea.android.common:trinea-android-common:4.2.15'. For source-based development: git clone https://github.com/Trinea/android-common.git && cd android-common && ./gradlew build.
Daily commands:
No standalone app—this is a library. Build the AAR for distribution: ./gradlew build. To test against a sample app, clone the companion AndroidDemo repository and integrate this library as a module dependency.
🗺️Map of the codebase
src/main/java/cn/trinea/android/common/service/impl/ImageCache.java— Core image caching orchestrator that coordinates memory and disk caches; must understand to implement custom cache strategies or extend caching behaviorsrc/main/java/cn/trinea/android/common/service/impl/SimpleCache.java— Abstract cache foundation implementing core get/put/remove logic; all cache implementations depend on this base abstractionsrc/main/java/cn/trinea/android/common/util/CacheManager.java— Singleton entry point for cache lifecycle management; required to understand initialization patterns and how caches are instantiated across the librarysrc/main/java/cn/trinea/android/common/service/Cache.java— Top-level cache interface defining get/put/remove/clear contracts; all caching subsystems implement or depend on thissrc/main/java/cn/trinea/android/common/service/impl/ImageMemoryCache.java— LRU in-memory bitmap cache using soft references; demonstrates memory management patterns critical for image handling on memory-constrained devicessrc/main/java/cn/trinea/android/common/util/DownloadManagerPro.java— Enhanced download manager wrapper providing queue, retry, and progress tracking; key utility for file persistence operations across the librarybuild.gradle— Build configuration defining SDK levels, dependencies, and compilation settings; required to understand library compatibility targets and external dependencies
🛠️How to make changes
Add a New Cache Removal Policy
- Create a new class extending
RemoveTypeXxxpattern insrc/main/java/cn/trinea/android/common/service/impl/(src/main/java/cn/trinea/android/common/service/impl/RemoveTypeLastUsedTimeFirst.java) - Implement
calculateSize(CacheObject)to define eviction criteria (return size of item to remove, or 0 to skip) (src/main/java/cn/trinea/android/common/service/impl/RemoveTypeLastUsedTimeFirst.java) - Register the new policy in
CacheFullRemoveTypeenum or pass it directly toSimpleCache.setRemoveTypeWhenFull()(src/main/java/cn/trinea/android/common/service/CacheFullRemoveType.java) - Test by creating a cache instance and verifying eviction order via
CacheManagerfactory methods (src/main/java/cn/trinea/android/common/util/CacheManager.java)
Add Custom Image Caching with Different Storage
- Create a new DAO implementation in
src/main/java/cn/trinea/android/common/dao/impl/extendingImageSDCardCacheDaoor implementingImageSDCardCache.ImageSDCardCacheDao(src/main/java/cn/trinea/android/common/dao/impl/ImageSDCardCacheDaoImpl.java) - Implement file I/O methods (saveBitmap, getBitmap, remove, clear) targeting your custom storage backend (
src/main/java/cn/trinea/android/common/dao/impl/ImageSDCardCacheDaoImpl.java) - Create a new service class in
src/main/java/cn/trinea/android/common/service/impl/implementingCache<String, Bitmap>using your DAO (src/main/java/cn/trinea/android/common/service/impl/ImageSDCardCache.java) - Register in
CacheManageror use directly; wire throughImageCachetwo-tier model if combining with memory layer (src/main/java/cn/trinea/android/common/util/ImageCacheManager.java)
Add a New Utility Helper Module
- Create a new class in
src/main/java/cn/trinea/android/common/util/with static helper methods (follow pattern ofFileUtils,StringUtils) (src/main/java/cn/trinea/android/common/util/FileUtils.java) - Use annotation
@NotProguardon public API methods to prevent code shrinking issues in minified builds (src/main)
🪤Traps & gotchas
No CI/CD pipeline visible—build failures may not be caught automatically. SD-card cache paths hardcoded to app cache directory; ensure WRITE_EXTERNAL_STORAGE permission in AndroidManifest (not auto-granted on Android 6+). Image cache default memory size tuning is aggressive; test OOM scenarios on low-memory devices. HttpCache does not handle redirects or chunked encoding natively—integrate with your HTTP client carefully. No Kotlin support; modern Android projects may encounter interop friction. Build targets Java 1.8 but library is Android API 21+; test thoroughly on older devices.
💡Concepts to learn
- LRU (Least Recently Used) Cache — ImageMemoryCache uses LRU eviction to automatically remove least-recently-accessed bitmaps when memory fills; understanding LRU is critical to tuning cache size and predicting memory behavior.
- Strategy Pattern (Pluggable Eviction Policies) — The library defines 15+ RemoveType* classes (FIFO, LIFO, by size, by time, by usage count) as interchangeable strategies; contributors must grasp the Strategy pattern to add new eviction algorithms.
- Data Access Object (DAO) Pattern — Separates cache storage logic (HttpCacheDaoImpl, ImageSDCardCacheDaoImpl) from business logic; essential for understanding how cache data is persisted to disk and retrieved.
- Two-Level Caching (Memory + Disk) — ImageCache uses in-memory (ImageMemoryCache) and SD-card (ImageSDCardCache) tiers; understanding cache hierarchy is crucial for API design and performance optimization.
- Android ContextCompat & SharedPreferences Serialization — HttpCache and ImageSDCardCache persist objects to disk using serialization; developers must be aware of Android's backward compatibility constraints and data format versioning.
- FIFO (First-In-First-Out) & LIFO (Last-In-First-Out) Queues — RemoveTypeEnterTimeFirst and RemoveTypeEnterTimeLast implement FIFO/LIFO eviction for use cases where insertion order (not access recency) determines cache lifetime.
- Priority Queue Eviction — RemoveTypePriorityHigh/Low allows assigning priority levels to cache entries; useful for ensuring high-value data (e.g., critical UI images) survives cache pressure.
🔗Related repos
square/picasso— Industry-standard image loading and caching library for Android; Trinea ImageCache is a more lightweight alternative with explicit eviction policy control for space-constrained apps.bumptech/glide— Modern, high-performance image loading with adaptive caching; similar use case but Glide is more feature-rich while Trinea offers finer-grained cache tuning and SD-card persistence.Trinea/AndroidDemo— Official companion sample app demonstrating usage patterns for all Trinea Android Common cache and UI widget features; essential reference for developers integrating the library.google/volley— Google's lightweight HTTP and image caching library for Android; Trinea HttpCache is a structural alternative emphasizing pluggable eviction over request queueing.codekk/Android-Lifecycle— Complementary reference from the Trinea ecosystem (codekk.com) documenting Android component lifecycles; useful context for managing cache initialization alongside Activity/Fragment lifecycle.
🪄PR ideas
To work on one of these in Claude Code or Cursor, paste:
Implement the "<title>" PR idea from CLAUDE.md, working through the checklist as the task list.
Add comprehensive unit tests for cache eviction policies (RemoveType* classes)
The repo implements 14 different cache removal strategies (RemoveTypeBitmapLarge, RemoveTypeLastUsedTimeFirst, RemoveTypePriorityHigh, etc.) in src/main/java/cn/trinea/android/common/service/impl/, but there are no visible test files. These policies are critical for cache correctness—LRU, FIFO, priority-based, and time-based eviction must be validated to prevent memory leaks and data loss in production apps.
- [ ] Create src/test/java/cn/trinea/android/common/service/impl/ directory structure
- [ ] Add unit tests for RemoveTypeLastUsedTimeFirst (verify LRU ordering)
- [ ] Add unit tests for RemoveTypePriorityHigh and RemoveTypePriorityLow (verify priority sorting)
- [ ] Add unit tests for RemoveTypeEnterTimeFirst (verify FIFO ordering)
- [ ] Add unit tests for RemoveTypeBitmapLarge and RemoveTypeBitmapSmall (verify size-based eviction)
- [ ] Add integration test verifying CacheFullRemoveType correctly chains multiple removal policies
Add unit tests for HttpCache persistence layer (HttpCacheDaoImpl, ImageSDCardCacheDaoImpl)
The DAO implementations in src/main/java/cn/trinea/android/common/dao/impl/ handle critical disk I/O operations for HTTP response and image caching. Without tests, regressions in serialization, file naming, database operations, or concurrent access could silently corrupt cached data across millions of apps using this library.
- [ ] Create src/test/java/cn/trinea/android/common/dao/impl/ directory
- [ ] Add tests for HttpCacheDaoImpl: verify cache hit/miss, serialization/deserialization of HttpResponse objects
- [ ] Add tests for ImageSDCardCacheDaoImpl: verify file naming consistency (FileNameRule implementations), concurrent writes, cleanup
- [ ] Add integration test for CacheObject expiration handling across both DAO implementations
- [ ] Add edge case tests: null responses, corrupted cache files, insufficient disk space handling
Add integration tests and documentation for ImageCache with CacheFullRemoveType strategies
ImageCache (src/main/java/cn/trinea/android/common/service/impl/ImageCache.java) coordinates memory cache (ImageMemoryCache), disk cache (ImageSDCardCache), and multiple eviction strategies via CacheFullRemoveType. This complex composition lacks documented behavior and integration tests, making it difficult for contributors to understand expected behavior when cache is full and multiple RemoveType policies interact.
- [ ] Create src/test/java/cn/trinea/android/common/service/impl/ImageCacheIntegrationTest.java
- [ ] Add test: verify ImageCache correctly cascades from memory → disk → eviction when memory full
- [ ] Add test: verify chained RemoveType policies (e.g., RemoveTypePriorityHigh + RemoveTypeLastUsedTimeFirst) execute in order
- [ ] Add test: verify ImageMemoryCache and ImageSDCardCache stay synchronized during evictions
- [ ] Add JavaDoc to ImageCache explaining the interaction between memory/disk caches and CacheFullRemoveType
- [ ] Add example code snippet in docs/ showing recommended cache configuration for different app types (media-heavy vs. lightweight)
🌿Good first issues
- Add unit tests for RemoveType eviction implementations (RemoveTypeLastUsedTimeFirst.java, RemoveTypeBitmapLarge.java, etc.): currently no test files visible in the src/ tree. A new contributor could write parametrized tests in src/test/java/ to verify each strategy orders cache entries correctly.
- Document the pluggable FileNameRule strategy (FileNameRuleImageUrl.java, FileNameRuleCurrentTime.java) with inline examples in the service/impl package; add a README section explaining how to implement custom FileNameRule for SD-card image naming.
- Add Kotlin extension functions (or a modern DSL builder) for ImageCache configuration in a new src/main/kotlin/ package, making the API more idiomatic for modern Android projects; e.g.,
imageCache { memorySize = 10.mb; sdCardSize = 100.mb; removeType = LRU }.
⭐Top contributors
Click to expand
Top contributors
📝Recent commits
Click to expand
Recent commits
56be038— Delete some files (Trinea)f0738f0— Fix http fail (Trinea)83329ef— Adapter for newest android (Trinea)0f17e6c— Update guideline (Trinea)77a29eb— Shell.execCommand support timeout (Trinea)9d53f32— execCommand support timeout (Trinea)afb1d8b— Update README.md (Trinea)58cc75c— Update README.md (Trinea)84350f7— Add Dev Tools App info (Trinea)43ebcee— Merge pull request #30 from zhangsl/master (Trinea)
🔒Security observations
Failed to generate security analysis.
LLM-derived; treat as a starting point, not a security audit.
👉Where to read next
- Open issues — current backlog
- Recent PRs — what's actively shipping
- Source on GitHub
Generated by RepoPilot. Verdict based on maintenance signals — see the live page for receipts. Re-run on a new commit to refresh.