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

  • SEARCH
  • Home
  • 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 8592367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:44:08+00:00 2026-06-11T23:44:08+00:00

I am writing an Android app which logs into my company’s server (SSL) and

  • 0

I am writing an Android app which logs into my company’s server (SSL) and gets my work schedule by simulating a browser login. The following code is working perfectly in Android 2.2 and Java, but causes a failed login in Android 4. It does not cause the app to crash, but can not log in. Not only is it faling in logging in, it shuts the user out of the server. This normally does not happen unless you hav tree consecutive failed login attempts.

static final Sting host0 = "http://someplace.com"
static final Sting host1 = "https://someplace.com/login";
static final String userAgent = "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0)"
System.setProperty("http.keepAlive", "true");

try{
Connection.Response res = Jsoup.connect(host0)
        .userAgent(userAgent)
        .followRedirects(true)
        .method(Method.GET)
        .execute();
cookies1 = res.cookies();

Connection.Response res1 = Jsoup.connect(host)
        .data("label1","calue1",
                "label2","calue2",
                "label3","calue3",
                "label4","calue4")
                .cookies(cookies1)
                .userAgent(userAgent)
                .followRedirects(true)
                .method(Method.POST)
                .execute();

Connection.Response res2 = Jsoup.connect(host)
        .data("label5","calue15",
                "label6","calue6",
                "label7","calue7",
                "label18","calue8")
                .cookies(cookies1)
                .userAgent(userAgent)
                .followRedirects(true)
                .method(Method.POST)
                .timeout(10000)
                .execute();
}
catch (IOException ioe) {
    ioe.printStackTrace();
    System.out.println("IOException handled in initializeDocArray()");
}
finally {}

I have been struggeling with this for several weeks now am now turning to you for help.

  1. What may be diffent in Android 4 causing this not to work (The process is not beeng performed in the UI thread). Can I expext to have the same problem using HttpClient off the apache library, or can it be a Jsoup problem.
  2. And more importantly How can I make this work. Any hints appreciated.

The IT-department is saying the server only support login through the IE8 browser, but I have never experienced my code not to work in Android 2.2 or Java

I anyone can help me solve this I will be very thankful!

  • 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-06-11T23:44:09+00:00Added an answer on June 11, 2026 at 11:44 pm

    I solved it by using the apache library iso Jsoup. Then I use Jsoup to parse the resposeBody from HttpClient. Works great.

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

Sidebar

Related Questions

I'm writing an Android app which receives data from a server. Theoretical there could
I am writing an Android app which communicates with a PHP backend. The backend
I am writing a small app in which android device tries to send a
I'm writing android app, which drawing 4 graphs in 1 plot. Graph data is
I am writing an Android app, part of which will be a survey involving
I'm writing an Android app. I have a main method, which creates and runs
I am looking into writing an Android app that has a database of approximately
I'm writing an Android app which will be making use of the cloud-2-device messaging
I'm writing an Android app for work that shows the status of our phone
I'm writing an android App which is basically finished and functions well on a

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.