Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1023925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:42:03+00:00 2026-05-16T11:42:03+00:00

i try to build an https client for android and i need do get

  • 0

i try to build an https client for android and i need do get some request of an Servlet
but when i use the getInputStream method the applicaion hangs.

There is no error only hanging when i call the method.

    String url = "https://.../Servlet";

  try {
   mPushLiteConnection = (HttpsURLConnection) new URL(url).openConnection();
   mPushLiteConnection.setDoOutput(true);
   mPushLiteConnection.setDoInput(true);
   mPushLiteConnection.setRequestMethod("POST");
   mPushLiteConnection.connect();

   subscribe();

   InputStream in = (InputStream)mPushLiteConnection.getInputStream();

   unsubscribe();

   mPushLiteConnection.disconnect();

  } catch (MalformedURLException e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
  } catch (IOException e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
  }

this is only to check the call, but it didtn work.
Any idea why it hangs and tell me nothing?

the subscribe method works, when i comment out the line with the inputstream, the server show me all is correct.
I can try the same with the Firefox and it works and i can see the request.

i also put the keystore into the TrustManager.

sorry for my english i hope i explain it ennougth.

THX

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T11:42:03+00:00Added an answer on May 16, 2026 at 11:42 am

    I think i know the reason!
    the method getInputStream() needs (why ever) the contentLength!
    In the servlet i want to connect to is no contentLength couse it is an push chunked servlet… it sends all the time pieces of XML without length.

    So.. HttpsURLConnection are not usefull for chunked!

    Now i try the same connection with httpClient
    i hope it works for it… if not: i jump behind the bus 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm following the following tutorial for Facebook Connect: https://developers.facebook.com/docs/mobile/android/build/ And attempting to allow my
This does not always happen, but sometimes when I try to build a (large)
The problem is I need to build a web service client from a file
Well, I am writing an android application and I want to use Socket.IO-Client for
I try build wrap panel with vertical buttons. Every button consist from image and
I try to build a JSF 2.0 Web application which is using libraries including
I try to build a nice box with only 1 image and 1 div.
I try to build a metro-style-app with Javascript and when I run the Windows
i try to build a app that is in landsscape mode all the time.
Im try to build my plugins that sit in a seperate directory on the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.