Android Network--------------about Android comes with Org.apache.http and Apache official (third party) httpclient issues

Source: Internet
Author: User

Recently want to talk about the network that block, suddenly found that Android comes with httplicent, but we usually develop also commonly used third-party httpclient (Apache official). As a result of the previous look at some of the predecessors so use, they have followed, but they did not consider these things at all. But recently I wanted to tidy it up and saw the problem again. I wonder if you will have the same doubts as I do? At the same time Apache things, why Android bring a copy, Apache own also have a copy? And the side of the class library is not the same.

I went online to check the results mentioned is not detailed, with this problem I am not in the mood to go down. So I want to get to the ins and outs, where they are different. Why there are so many less method classes on Android.

Start looking at the Android document, not what it is, just saying that it was deprecated in Api22. For the moment, do not say abandoned things. There is no more introduction about HttpClient. So I turned to Apache official. Check out Apache httpcomponents contains several blocks. I tracked down the httpcomponents client.


This is the piece of the Apache httpclient that is part of the piece about the parts for Android


Point in, the results are clear.


The above background introduction, in the Google Android1.0 version of the time, the Apache 4.0 version integrated into the. At that time 4.0 was a relatively mature project, Apache official began to think that Android with the upgrade will httpclient will also upgrade integration. But Google has not done so. So slowly Android stopped the development of Android inside the HttpClient, and the official Apache also slowly with the maintenance upgrade has become a branch. Finally Android does not maintain Android's own httpclient and also refuses to upgrade Apache official httpclient for reasons of incompatibility. So Apache Light released the Httpclicent for Android. It is now compatible with older versions of Android APIs to prevent conflicts. Before we could use the time to import, there will be conflicts, to Apache HttpClient 4.3, has started compatible with Android.

Previously used 3. X Commons version of the user, Apache also strongly recommends upgrading to the newest.

So, the obsolete Android HttpClient mentioned in Android API 22 I think part of the reason may also be because of this. Android abandoned httpclient has nothing to do with the httpclient officially provided by Apache. We can still use third-party httpclient (Apache).


Android Network--------------about Android comes with Org.apache.http and Apache official (third party) httpclient issues

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.