Is your feature request related to a problem? Please describe.
Problem
Currently, the A2A Java SDK hardcodes the use of JdkA2AHttpClient in several places (such as A2A.java and various transport providers). This client relies on java.net.http.HttpClient, which is not available in standard Android environments, making the SDK unusable on Android.
Additionally, when running on Android, Jackson fails to deserialize Java records properly without explicit property annotations, leading to parsing errors for spec models.
Describe the solution you'd like
Proposed Solution
- SPI Pattern: Introduce
A2AHttpClientFactory and A2AHttpClientProvider using Java's ServiceLoader (SPI) to dynamically load the best HTTP client available on the classpath.
- Android Client: Implement
AndroidA2AHttpClient using HttpURLConnection (which is safe for Android).
- Jackson Fixes: Add
@JsonProperty annotations to records in the spec/ module to ensure they can be parsed on Android.
Describe alternatives you've considered
No response
Additional context
Goal
The goal is to make the http-client module compatible with Android by:
- Decoupling the HTTP client implementation so it is not hardcoded to the JDK client.
- Providing an Android-compatible HTTP client implementation.
- Fixing the Jackson parsing issues for records on Android.
Code of Conduct
Is your feature request related to a problem? Please describe.
Problem
Currently, the A2A Java SDK hardcodes the use of
JdkA2AHttpClientin several places (such asA2A.javaand various transport providers). This client relies onjava.net.http.HttpClient, which is not available in standard Android environments, making the SDK unusable on Android.Additionally, when running on Android, Jackson fails to deserialize Java records properly without explicit property annotations, leading to parsing errors for spec models.
Describe the solution you'd like
Proposed Solution
A2AHttpClientFactoryandA2AHttpClientProviderusing Java'sServiceLoader(SPI) to dynamically load the best HTTP client available on the classpath.AndroidA2AHttpClientusingHttpURLConnection(which is safe for Android).@JsonPropertyannotations to records in thespec/module to ensure they can be parsed on Android.Describe alternatives you've considered
No response
Additional context
Goal
The goal is to make the
http-clientmodule compatible with Android by:Code of Conduct