Declaring dependencies

To add a dependency on Futures, you must add the Google Maven repository to your project. Read Google's Maven repository for more information.

Add the dependencies for the artifacts you need in the build.gradle file for your app or module:

dependencies {
    def futures_version = "1.0.0-beta01"

    implementation "androidx.concurrent:concurrent-futures:$futures_version"
    implementation "androidx.concurrent:concurrent-listenablefuture:$futures_version"
    implementation "androidx.concurrent:concurrent-listenablefuture-callback:$futures_version"

For more information about dependencies, see Add Build Dependencies.

Concurrent-ListenableFuture Version 1.0.0-beta01

May 30th, 2019

androidx.concurrent:concurrent-listenablefuture:1.0.0-beta01 and androidx.concurrent:concurrent-listenablefuture-callback:1.0.0-beta01 are released. The commits included in this version can be found here.

These libraries provide a standalone equivalent to Guava’s ListenableFuture interface and an adapter for converting callbacks.

The previously-released androidx.concurrent:concurrent-futures artifact, which provided a similar adapter and included the artifact, may be problematic for developers using toolchains -- such as Android Gradle Plugin 3.4.0 -- with strict dependency resolution matching. Developers who do not rely on the full Guava library are advised to switch to androidx.concurrent:concurrent-listenablefuture-callback.

Version 1.0.0-beta01

May 7, 2019

androidx.concurrent:concurrent-futures:1.0.0-beta01 is released. The commits included in this version can be found here.

API changes

  • ResolvableFuture and AbstractResolvableFuture were hidden from public api in favor CallbackToFutureAdapter that provides safer API.

Version 1.0.0-alpha03

December 17, 2018

androidx.concurrent:concurrent-futures 1.0.0-alpha03 is released.

New features

  • CallbackToFutureAdapter was introduced. It’s a new, safer API to wrap a callback driven API into ListenableFuture. Prefer it over using ResolvableFuture.