Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

340
Visualizações
How can I use JDK 11 HTTP packages in Android

I am a Web Applications developer using J2EE Technology. I have made extensive use of Oracle's / OpenJDK's HTTP packages, as I find them more comfortable fo development.

https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpClient.html

import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

Today, I wish to write an Android Application in Java using the same packages but I somehow couldn't find them. I could find OkHttpClient, Apache's HttpClient as well but I am keen on using OpenJDK's HTTPClient.

There are of course many suggesting to use Apache's HTTPClient but I am not looking for that.

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

Today, I wish to write an Android Application in Java using the same packages but I somehow couldn't find them

The Android SDK does not include everything in any particular Java SDK, especially J2EE. And, at the present time, the Android SDK tops out at Java 8 — classes, methods, and other items introduced after that are not in the Android SDK.

I am keen on using OpenJDK's HTTPClient

You are welcome to attempt to backport HTTPClient to work on the Android SDK. A quick glance at the source code suggests that it depends too much on things that the Android SDK lacks, and so that backport would be tedious at best and may not succeed. It also will require you to license your app (or anything else that uses this backport) under the GPL, which you may or may not want to do.

Also, if other developers will work on this project, you should be making your decisions on what to use based on what is best for the team (and, if relevant, the company or other organization that your team belongs to). Investing in this backport effort may not be the best option, compared to using OkHttp.

over 4 years ago · Santiago Trujillo Relatório

0

The answer to your question is no. The top fully supported version of Java is Java 8. As a complements, you can check the links below for more details and understanding.

  1. Use Java 8 language features and APIs
  2. Java 8+ APIs available through desugaring
  3. Does java 11 support android?
  4. For more Android Http Client
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda