{"id":15068797,"url":"https://github.com/sgtsilvio/android-retrofix","last_synced_at":"2026-02-16T02:31:02.592Z","repository":{"id":165504374,"uuid":"196088225","full_name":"SgtSilvio/android-retrofix","owner":"SgtSilvio","description":"Backports Java 8 APIs (java.util.Optional, java.util.function, java.util.stream, java.util.concurrent.CompletableFuture, java.time) to Android below API 24 (Android 7.0 Nougat)","archived":false,"fork":false,"pushed_at":"2025-06-24T22:50:05.000Z","size":570,"stargazers_count":67,"open_issues_count":3,"forks_count":7,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-24T23:33:19.957Z","etag":null,"topics":["android","android-java8","backport","gradle-plugin","java8","retrofit"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SgtSilvio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-07-09T21:45:34.000Z","updated_at":"2025-05-08T09:51:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"296874c5-09ff-497c-8f10-c1bb2049202e","html_url":"https://github.com/SgtSilvio/android-retrofix","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/SgtSilvio/android-retrofix","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SgtSilvio%2Fandroid-retrofix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SgtSilvio%2Fandroid-retrofix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SgtSilvio%2Fandroid-retrofix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SgtSilvio%2Fandroid-retrofix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SgtSilvio","download_url":"https://codeload.github.com/SgtSilvio/android-retrofix/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SgtSilvio%2Fandroid-retrofix/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267685009,"owners_count":24127704,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-java8","backport","gradle-plugin","java8","retrofit"],"created_at":"2024-09-25T01:39:18.836Z","updated_at":"2026-02-16T02:31:02.585Z","avatar_url":"https://github.com/SgtSilvio.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Android RetroFix\n\n[![Gradle Plugin Portal](https://img.shields.io/gradle-plugin-portal/v/com.github.sgtsilvio.gradle.android-retrofix?color=brightgreen\u0026style=for-the-badge)](https://plugins.gradle.org/plugin/com.github.sgtsilvio.gradle.android-retrofix)\n[![GitHub](https://img.shields.io/github/license/sgtsilvio/android-retrofix?color=brightgreen\u0026style=for-the-badge)](LICENSE)\n[![GitHub Workflow Status (with branch)](https://img.shields.io/github/actions/workflow/status/sgtsilvio/android-retrofix/check.yml?branch=main\u0026style=for-the-badge)](https://github.com/SgtSilvio/android-retrofix/actions/workflows/check.yml?query=branch%3Amain)\n\nSeamlessly backports Java 8 APIs to Android below API 24 (Android 7.0 Nougat)\n\nSeamless means that you use the official Java 8 APIs, or libraries that internally use the official Java 8 APIs,\nand the plugin replaces the official Java 8 APIs with backport libraries only in the generated artifact.\nWhen you increase the minimum Android API level to 24 or higher in the future, \nyou will only need to remove the plugin and the backport dependencies.\nYou do not have to change your code.\n\nAlthough Android by now supports\n[some Java 8 APIs through desugaring](https://developer.android.com/studio/write/java8-support-table),\nsome important APIs are still not possible to use on Android APIs below 24 - for example `CompletableFuture`.\n\n## How to Use\n\n`settings.gradle(.kts)`:\n\n```kotlin\npluginManagement {\n    repositories {\n        google() // to retrieve the google android plugins\n        gradlePluginPortal() // to retrieve this plugin\n    }\n}\n//...\n```\n\n`app/build.gradle(.kts)`:\n\n```kotlin\nplugins {\n    id(\"com.android.application\")\n    id(\"com.github.sgtsilvio.gradle.android-retrofix\") version \"1.1.0\"\n    //...\n}\n\nandroid {\n    //...\n    defaultConfig {\n        //...\n        minSdk = 21 // has to be \u003c 24, if you have 24+ this plugin is not needed\n        //...\n    }\n    //...\n    compileOptions {\n        sourceCompatibility = JavaVersion.VERSION_1_8 // enables lambdas, method references,\n        targetCompatibility = JavaVersion.VERSION_1_8 //         default methods, static interface methods\n    }\n    //...\n}\n\ndependencies {\n    retrofix(\"net.sourceforge.streamsupport:android-retrostreams:1.7.4\") // for backporting streams\n    retrofix(\"net.sourceforge.streamsupport:android-retrofuture:1.7.4\") // for backporting future\n    retrofix(\"org.threeten:threetenbp:1.7.2\") // for backporting time\n    // or retrofix(\"com.jakewharton.threetenabp:threetenabp:1.4.9\")\n    //...\n}\n```\n\nAndroid Studio will still display an error \"Call requires API level 24 (current min is 21)\".\nThis error is actually just a warning.\nAndroid Studio does not know that we backport the API, so it still thinks that the API can not be used with the\nminSdkVersion.\nYou can build and run your app without any problems.\nIf you want to get rid of the warning, just add `@SuppressLint(\"NewApi\")` to the method or class where you use the API.\n\n## Requirements\n\n- Gradle 7.0 or higher\n- Android Gradle Plugin 7.2.0 or higher\n\n## Supported Backport Libraries\n\nThe following sections list the backported APIs when adding the respective backport library as dependency.\n\n### [android-retrostreams](https://github.com/retrostreams/android-retrostreams)\n\nDependency:\n```kotlin\ndependencies {\n    retrofix(\"net.sourceforge.streamsupport:android-retrostreams:1.7.4\")\n}\n```\n\nBackported new types:\n- `java.lang.FuncionalInterface`\n- `java.util.IntSummaryStatistics`, `java.util.DoubleSummaryStatistics`, `java.util.LongSummaryStatistics`\n- `java.util.Optional**`\n- `java.util.PrimitiveIterator**`\n- `java.util.Spliterator**`\n- `java.util.SplittableRandom`\n- `java.util.StringJoiner`\n- `java.util.concurrent.CountedCompleter`\n- `java.util.concurrent.ForkJoinPool`\n- `java.util.concurrent.ForkJoinTask`\n- `java.util.concurrent.ForkJoinWorkerThread`\n- `java.util.concurrent.RecursiveAction`\n- `java.util.concurrent.RecursiveTask`\n- `java.util.concurrent.ThreadLocalRandom`\n- `java.util.function.**`\n- `java.util.stream.**`\n\nBackported static/default methods of:\n- `java.lang.Arrays`\n- `java.lang.Integer`, `java.lang.Double`, `java.lang.Long`\n- `java.lang.Iterable`\n- `java.lang.Objects`\n- `java.util.Collection`\n- `java.util.Comparator`\n- `java.util.Iterator`\n- `java.util.List`\n- `java.util.Map`\n- `java.util.Map$Entry`\n- `java.util.concurrent.ConcurrentMap`\n\n### [android-retrofuture](https://github.com/retrostreams/android-retrofuture)\n\nDependency:\n```kotlin\ndependencies {\n    retrofix(\"net.sourceforge.streamsupport:android-retrofuture:1.7.4\")\n}\n```\n\nBackported new types:\n- `java.util.concurrent.CompletableFuture`\n- `java.util.concurrent.CompletionException`\n- `java.util.concurrent.CompletionStage`\n\n### [threetenbp](https://github.com/ThreeTen/threetenbp) or [threetenabp](https://github.com/JakeWharton/ThreeTenABP)\n\nDependency:\n```kotlin\ndependencies {\n    retrofix(\"org.threeten:threetenbp:1.7.2\")\n    // or \n    retrofix(\"com.jakewharton.threetenabp:threetenabp:1.4.9\")\n}\n```\n\nBackported new types:\n- `java.time.**`\n- `java.time.chrono.**`\n- `java.time.format.**`\n- `java.time.temporal.**`\n- `java.time.zone.**`\n\nBackported conversion methods of:\n- `java.util.Date`\n- `java.util.Calendar`\n- `java.util.GregorianCalendar`\n- `java.util.TimeZone`\n- `java.sql.Date`\n- `java.sql.Time`\n- `java.sql.Timestamp`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsgtsilvio%2Fandroid-retrofix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsgtsilvio%2Fandroid-retrofix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsgtsilvio%2Fandroid-retrofix/lists"}