Skip to content

About

Android Commons is a set of libraries that I have been creating and collecting throughout these years of development and that I use continuously in my new developments in order to avoid having to maintain the code in different sources.

Topics

Resources

Stars

3 stars

Watchers

2 watching

Forks

Latest commit

Β 

History

979 Commits

Folders and files

Repository files navigation

Android Commons

CI Publish codecov Maven Central API License

A comprehensive collection of modular Android libraries providing utilities, extensions, and common functionality for modern Android development.

πŸ“‹ Overview

Android Commons is a curated set of libraries designed to accelerate Android development by providing reusable components and utilities. Each module is independent, allowing you to include only what you need, keeping your app size minimal.

✨ Key Features

  • 🎯 Modular Architecture - Include only the modules you need
  • πŸš€ Modern Android - Built with Kotlin, Coroutines, and Jetpack Compose
  • πŸ§ͺ Tested - Unit tests with coverage reported to Codecov
  • πŸ“¦ Small Footprint - Minimal dependencies per module
  • πŸ”„ Active Maintenance - Regular updates and improvements

πŸ“š Available Modules

Module Description Documentation Latest Version
Bill of Materials
commons-bom BOM for version management - Maven Central
Core & Android
commons-core Core utilities and extensions πŸ“– Docs Maven Central
commons-android Android-specific utilities and extensions πŸ“– Docs Maven Central
commons-android-compose Jetpack Compose utilities πŸ“– Docs Maven Central
commons-android-test Android testing utilities πŸ“– Docs Maven Central
Storage (Room)
commons-android-room Room BaseDao helpers πŸ“– Docs Maven Central
Async & Concurrency
commons-coroutines Kotlin Coroutines extensions πŸ“– Docs Maven Central
commons-coroutines-test Coroutines testing utilities πŸ“– Docs Maven Central
Networking
commons-network Network utilities and interceptors πŸ“– Docs Maven Central
Pagination
commons-pagination Base pagination framework πŸ“– Docs Maven Central
commons-pagination-co Coroutines-based pagination πŸ“– Docs Maven Central
Permissions
commons-permissions Runtime permissions management πŸ“– Docs Maven Central
Storage
commons-preferences SharedPreferences JSON extensions (kotlinx.serialization) πŸ“– Docs Maven Central
Date & Time
commons-time java.time date/time extensions (no init needed) πŸ“– Docs Maven Central

🎯 Scope

Commons holds app-agnostic utilities with no DI framework, no Firebase/Play SDKs and no opinionated UI/design system. Framework pieces (DI, use case contracts, Failure, screen framework, theme) belong in android-platform.

Removed modules

commons-threetenabp, commons-threetenabp-test (use commons-time) and commons-android-binding were removed; last published versions remain on Maven Central.

Removed APIs

Unused public APIs were removed in the next major version of each module. Each module README lists them, with the suggested replacement, in its "Removed in" section.

πŸš€ Getting Started

Requirements

  • Min SDK: 28 (Android 9)
  • Target SDK: 36 (Android 16)
  • Compile SDK: 36
  • Kotlin: 2.3+
  • Java: 17

Installation

Using BOM (Bill of Materials) 🎯

The Bill of Materials (BOM) manages all library versions automatically, ensuring compatibility between modules.

Latest BOM version: Maven Central

dependencies {
    // Import the BOM with the latest version (check badge above)
    implementation(platform("com.raxdenstudios:commons-bom:<latest-version>"))
    
    // Add modules without specifying versions
    implementation("com.raxdenstudios:commons-core")
    implementation("com.raxdenstudios:commons-android")
    implementation("com.raxdenstudios:commons-android-compose")
    implementation("com.raxdenstudios:commons-android-room")
    implementation("com.raxdenstudios:commons-coroutines")
    implementation("com.raxdenstudios:commons-network")
    implementation("com.raxdenstudios:commons-pagination")
    implementation("com.raxdenstudios:commons-pagination-co")
    implementation("com.raxdenstudios:commons-permissions")
    implementation("com.raxdenstudios:commons-preferences")
    implementation("com.raxdenstudios:commons-time")
    
    // Testing modules
    testImplementation("com.raxdenstudios:commons-coroutines-test")
    testImplementation("com.raxdenstudios:commons-android-test")
}

Benefits of using BOM:

  • βœ… No need to specify versions for each module
  • βœ… Guaranteed compatibility between all modules
  • βœ… Easier updates - just change the BOM version
  • βœ… Prevents version conflicts

πŸ§ͺ Testing

Run the unit tests with:

./gradlew testDebugUnitTest

For coverage reports:

./gradlew testDebugUnitTest coverageReport

πŸ“– Documentation

Detailed documentation for each module is available in their respective directories:

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

Copyright 2015 Ángel Gómez

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

About

Android Commons is a set of libraries that I have been creating and collecting throughout these years of development and that I use continuously in my new developments in order to avoid having to maintain the code in different sources.

Topics

Resources

Stars

3 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages