The second Android 11 Developer Preview is now available, test it out and share your feedback.

Concurrent

Latest Update Current Stable Release Next Release Candidate Beta Release Alpha Release
December 18, 2019 1.0.0 - - 1.1.0-alpha01

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 {
    implementation "androidx.concurrent:concurrent-futures:1.0.0"

    // Kotlin
    implementation "androidx.concurrent:concurrent-futures-ktx:1.1.0-alpha01"
}

For more information about dependencies, see Add Build Dependencies.

Version 1.1.0

Version 1.1.0-alpha01

December 18, 2019

androidx.concurrent:concurrent-futures:1.1.0-alpha01 and androidx.concurrent:concurrent-futures-ktx:1.1.0-alpha01 are released. Version 1.1.0-alpha01 contains these commits. This is first release of androidx.concurrent:concurrent-futures-ktx.

New features

  • Kotlin extensions to help convert between ListenableFuture and Kotlin Coroutines are now available in concurrent-futures-ktx. This artifact is meant to be used with com.google.guava:listenablefuture as opposed to the full Guava library, which is a lightweight substitute for Guava that only contains ListenableFuture. For users of the full Guava library, you should use the official ListenableFuture extensions from kotlinx.coroutines.kotlinx-coroutines-guava instead.

API changes

  • Adds a suspending ListenableFuture.await() extension which converts a ListenableFuture to a Kotlin Coroutine

Version 1.0.0

Version 1.0.0

October 9, 2019

androidx.concurrent:concurrent-futures:1.0.0 is released. Version 1.0.0 contains these commits.

Important features of 1.0.0

androidx.concurrent:concurrent-futures:1.0.0 provides CallbackToFutureAdapterclass, a minimalistic utility that allows to wrap callback based code and return instances of ListenableFuture. It is useful for libraries that would like to expose asynchronous operations in their java APIs in a more elegant way than custom callbacks, but don’t do enough multithreading heavy-lifting to take a dependency on full guava or rx java due to library size concerns.

Version 1.0.0-rc01

August 7, 2019

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

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 com.google.guava:listenablefuture 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.