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 3800924
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T13:58:08+00:00 2026-05-19T13:58:08+00:00

First time Java programmer. I’m wondering what my options are for loading XML on

  • 0

First time Java programmer. I’m wondering what my options are for loading XML on the Android platform (java). There are few docs/demos on connectivity and data loading out there (AFAIK). I need to sign a request with basic authentication and then GET/POST/PUT/DELETE to a URL which will return application/xml content-type. Basically I need to emulate this type of cURL request in Java:

curl  -H 'Content-type: application/xml' -H 'Accept: application/xml' \
      -u '{account}/{username}:{apikey}' https://mywebsite.com

Should I just use the HttpClient in org.apache or is there a better solution? Once I’ve loaded an XML response from my API, what is the recommeded parser for Android. There seems to be so many parsers for Java, I’m completely overwhelmed.

  • 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-19T13:58:09+00:00Added an answer on May 19, 2026 at 1:58 pm

    Certainly use HTTPClient, it should work on Android and it is so much easier to make the calls than writing one yourself… here’s an example:-

        // Create a new HttpClient and Post Header
        HttpClient httpclient = new DefaultHttpClient();
        HttpPost httppost = new HttpPost("http://www.yoursite.com/script.php");
    
        try {
            // Add your data
            List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
            nameValuePairs.add(new BasicNameValuePair("id", "12345"));
            nameValuePairs.add(new BasicNameValuePair("stringdata", "AndDev is Cool!"));
            httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
    
            // Execute HTTP Post Request
            HttpResponse response = httpclient.execute(httppost);
    
        } catch (ClientProtocolException e) {
            // TODO Auto-generated catch block
        } catch (IOException e) {
            // TODO Auto-generated catch block
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a Java project using Netbeans for the first time. I
When loading a page for the first time (!IsPostback), I am creating a button
It's the first time I use java Rmi*. I have a custom class which
I'm using the java.util.concurrency framework for the first time. Here's a very simplified version
I d like to show rainbow colors in java, so the color first time:
I've tried working with swing (for the first time) a few weeks ago and
first time SO user :) I know that I can format a number like
The first time I load the website in the production web server, it start
The first time I try to open a particular form many of the controls
This is my first time attempting to call an ASP.NET page method from jQuery.

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.