You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Andrew Hardy <an...@sky.com> on 2019/03/20 00:20:29 UTC

HttpClient for Android - but no HttpCore for Android

I think HttpClient for Android uses org.apache.http.namevaluepair defined 
in HttpCore for some methods of its class URLEncodedUtilsHC4. However, I 
can find no Android version of HttpCore. How, therefore, do I use methods 
of URLEncodedUtilsHC4 in Android or are there any alternatives? In 
particular the equivalent use parse methods.


Hope this makes proper sense, or maybe I have misunderstood things.


Many thanks,


Andrew.




Sent with AquaMail for Android
https://www.mobisystems.com/aqua-mail



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: HttpClient for Android - but no HttpCore for Android

Posted by Andrew Hardy <an...@sky.com>.
That's great,

Thanks Oleg.


On March 20, 2019 14:39:27 Oleg Kalnichevski <ol...@apache.org> wrote:

> On Wed, 2019-03-20 at 00:20 +0000, Andrew Hardy wrote:
>> I think HttpClient for Android uses org.apache.http.namevaluepair
>> defined
>> in HttpCore for some methods of its class URLEncodedUtilsHC4.
>> However, I
>> can find no Android version of HttpCore. How, therefore, do I use
>> methods
>> of URLEncodedUtilsHC4 in Android or are there any alternatives? In
>> particular the equivalent use parse methods.
>>
>>
>>
>>
>> Hope this makes proper sense, or maybe I have misunderstood things.
>>
>>
>>
>>
>> Many thanks,
>>
>>
>>
>>
>> Andrew.
>
> Hi Andrew
>
> HttpCore code got folded into Android distribution of HttpClient for
> the sake of simplicity.
>
> I am presently working on making sure that stock versions of Apache
> HttpClient 4.5 and 5.0 could be run on Android without any
> modifications but I have been doing all this work outside ASF as my own
> personal project.
>
> In your case I would just recommend using Apache HttpCore 5.0 which
> should just work on Android out of the box.
>
> Cheers
>
> Oleg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org


Sent with AquaMail for Android
https://www.mobisystems.com/aqua-mail



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: HttpClient for Android - but no HttpCore for Android

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Thu, 2019-03-28 at 02:21 +0000, Andrew Hardy wrote:
> I am really sorry to contact again.  I am still a little confused.
> 
> I am confused as to how to make this work with these dependancies as
> I 
> think was suggested:
> 
>      implementation 'org.apache.httpcomponents:httpclient-
> android:4.3.5.1'
>      implementation 'org.apache.httpcomponents.core5:httpcore5:5.0-
> beta7'
>      implementation 
> 'org.apache.httpcomponents.client5:httpclient5:5.0-beta3'
> 
> If I use for example
> org.apache.http.client.entity.UrlEncodedFormEntityHC4
> 
> its constructor cannot be resolved since
> 
> public UrlEncodedFormEntityHC4 (
>          final List <? extends NameValuePair> parameters,
>          final String charset)
> 
> is refering to org.apache.http.NameValuePair which with these
> dependancies
> does not exist only org.apache.hc.core5.http.NameValuePair.
> 
> Ought I to be simply using an older version of client and core or
> will this
> create other conflicts?  Which versions would be best?
> 

No worries, Andrew

Just forget 'org.apache.httpcomponents:httpclient-android:4.3.5.1',
remove it from the dependency set and only use classes from
'org.apache.hc.httpcore5' and 'org.apache.hc.httpclient5' namespaces.

Hope this helps

Oleg



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: HttpClient for Android - but no HttpCore for Android

Posted by Andrew Hardy <an...@sky.com>.
I am really sorry to contact again.  I am still a little confused.

I am confused as to how to make this work with these dependancies as I 
think was suggested:

     implementation 'org.apache.httpcomponents:httpclient-android:4.3.5.1'
     implementation 'org.apache.httpcomponents.core5:httpcore5:5.0-beta7'
     implementation 
'org.apache.httpcomponents.client5:httpclient5:5.0-beta3'

If I use for example org.apache.http.client.entity.UrlEncodedFormEntityHC4

its constructor cannot be resolved since

public UrlEncodedFormEntityHC4 (
         final List <? extends NameValuePair> parameters,
         final String charset)

is refering to org.apache.http.NameValuePair which with these dependancies
does not exist only org.apache.hc.core5.http.NameValuePair.

Ought I to be simply using an older version of client and core or will this
create other conflicts?  Which versions would be best?

Sorry again.

Thank you.




On 26/03/2019 08:02, Oleg Kalnichevski wrote:
> On Tue, 2019-03-26 at 01:26 +0000, Andrew Hardy wrote:
>> Hi,
>>
>>
>> Thank you so much for all your work in porting
>> org.apache.httpcomponents:httpclient to Android.  I appreciate the
>> benefits you are making available.  I am in the process of up
>> versioning
>> some old Android code that used httpclient and I am swapping for you
>> Android port.  I have run into a little difficulty and I wonder if
>> you
>> would be so kind as to help me understand where I am going wrong.
>>
>> I am using the following dependancies:
>>
>>       implementation 'org.apache.httpcomponents:httpclient-
>> android:4.3.5.1'
>>       implementation 'org.apache.httpcomponents.core5:httpcore5:5.0-
>> beta7'
>>
>> However, there are still 7 Classes which I used in my old code which
>> I
>> cannot now find in either httpclient-android nor httpcore5, either
>> same
>> named or renamed.  I would be very grateful if you could point me in
>> the
>> right direction
>>
>> import org.apache.http.client.ClientProtocolException; // cannot find
>> in
>> httpclient-android but is in original client 4.0
>> import org.apache.http.client.HttpClient; // cannot find in
>> httpclient-android but is in original client 4.0
>> import org.apache.http.client.protocol.ClientContext; // cannot find
>> in
>> httpclient-android but is in original client 4.0
>> import org.apache.http.cookie.Cookie; // cannot find in
>> httpclient-android but is in original client 4.5
>> import org.apache.http.client.CookieStore; // cannot find in
>> httpclient-android but is in original client 4.0
>> import org.apache.http.impl.client.DefaultHttpClient; // cannot find
>> in
>> httpclient-android but is in original client 4.5
>> import org.apache.http.protocol.HTTP; // cannot find
>>
>> Many thanks indeed.
>>
> Those are HttpClient classes. Please use HttpClient 5.0, not just
> HttpCore 5.0
>
> Here is a HttpClient 5.0 migration guide that you may find useful.
>
> https://ok2c.github.io/httpclient-migration-guide/
>
> Oleg
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
>
>
> ---
> This email has been checked for viruses by AVG.
> https://www.avg.com
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: HttpClient for Android - but no HttpCore for Android

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Tue, 2019-03-26 at 11:15 +0000, Andrew Hardy wrote:
> I think I have a fundamental misunderstanding (probably not
> appropriate to 
> discuss on this forum I guess) or I am reading wrong our incomplete 
> articles or documents or not reading enough.
> 
> I read that a class file contains Java byte code to be executed on
> jvm and 
> also that Java byte code in jar files cannot be executed by Android,
> but 
> that Java classes are compiled into a proprietory byte code to run
> on 
> dalvic not jvm.
> 
> This led me to understand that I must only add dependant items which 
> indicate (by their name?) they are specifically for Android.
> 
> However HttpClient 5.0 and HttpCore 5.0 do not seem to clearly
> indicate 
> they are Android byte code only.  Are they?
> 
> 

They are not. They do not have to be specifically designed for Android.
They just need to avoid references to classes not available on Android.

Oleg



> 
> 
> On March 26, 2019 08:02:32 Oleg Kalnichevski <ol...@apache.org>
> wrote:
> 
> > On Tue, 2019-03-26 at 01:26 +0000, Andrew Hardy wrote:
> > > Hi,
> > > 
> > > 
> > > Thank you so much for all your work in porting
> > > org.apache.httpcomponents:httpclient to Android.  I appreciate
> > > the
> > > benefits you are making available.  I am in the process of up
> > > versioning
> > > some old Android code that used httpclient and I am swapping for
> > > you
> > > Android port.  I have run into a little difficulty and I wonder
> > > if
> > > you
> > > would be so kind as to help me understand where I am going wrong.
> > > 
> > > I am using the following dependancies:
> > > 
> > > implementation 'org.apache.httpcomponents:httpclient-
> > > android:4.3.5.1'
> > > implementation 'org.apache.httpcomponents.core5:httpcore5:5.0-
> > > beta7'
> > > 
> > > However, there are still 7 Classes which I used in my old code
> > > which
> > > I
> > > cannot now find in either httpclient-android nor httpcore5,
> > > either
> > > same
> > > named or renamed.  I would be very grateful if you could point me
> > > in
> > > the
> > > right direction
> > > 
> > > import org.apache.http.client.ClientProtocolException; // cannot
> > > find
> > > in
> > > httpclient-android but is in original client 4.0
> > > import org.apache.http.client.HttpClient; // cannot find in
> > > httpclient-android but is in original client 4.0
> > > import org.apache.http.client.protocol.ClientContext; // cannot
> > > find
> > > in
> > > httpclient-android but is in original client 4.0
> > > import org.apache.http.cookie.Cookie; // cannot find in
> > > httpclient-android but is in original client 4.5
> > > import org.apache.http.client.CookieStore; // cannot find in
> > > httpclient-android but is in original client 4.0
> > > import org.apache.http.impl.client.DefaultHttpClient; // cannot
> > > find
> > > in
> > > httpclient-android but is in original client 4.5
> > > import org.apache.http.protocol.HTTP; // cannot find
> > > 
> > > Many thanks indeed.
> > 
> > Those are HttpClient classes. Please use HttpClient 5.0, not just
> > HttpCore 5.0
> > 
> > Here is a HttpClient 5.0 migration guide that you may find useful.
> > 
> > https://ok2c.github.io/httpclient-migration-guide/
> > 
> > Oleg
> > 
> > 
> > 
> > -----------------------------------------------------------------
> > ----
> > To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> > For additional commands, e-mail: dev-help@hc.apache.org
> 
> 
> Sent with AquaMail for Android
> https://www.mobisystems.com/aqua-mail
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: HttpClient for Android - but no HttpCore for Android

Posted by Andrew Hardy <an...@sky.com>.
I think I have a fundamental misunderstanding (probably not appropriate to 
discuss on this forum I guess) or I am reading wrong our incomplete 
articles or documents or not reading enough.

I read that a class file contains Java byte code to be executed on jvm and 
also that Java byte code in jar files cannot be executed by Android, but 
that Java classes are compiled into a proprietory byte code to run on 
dalvic not jvm.

This led me to understand that I must only add dependant items which 
indicate (by their name?) they are specifically for Android.

However HttpClient 5.0 and HttpCore 5.0 do not seem to clearly indicate 
they are Android byte code only.  Are they?




On March 26, 2019 08:02:32 Oleg Kalnichevski <ol...@apache.org> wrote:

> On Tue, 2019-03-26 at 01:26 +0000, Andrew Hardy wrote:
>> Hi,
>>
>>
>> Thank you so much for all your work in porting
>> org.apache.httpcomponents:httpclient to Android.  I appreciate the
>> benefits you are making available.  I am in the process of up
>> versioning
>> some old Android code that used httpclient and I am swapping for you
>> Android port.  I have run into a little difficulty and I wonder if
>> you
>> would be so kind as to help me understand where I am going wrong.
>>
>> I am using the following dependancies:
>>
>> implementation 'org.apache.httpcomponents:httpclient-
>> android:4.3.5.1'
>> implementation 'org.apache.httpcomponents.core5:httpcore5:5.0-
>> beta7'
>>
>> However, there are still 7 Classes which I used in my old code which
>> I
>> cannot now find in either httpclient-android nor httpcore5, either
>> same
>> named or renamed.  I would be very grateful if you could point me in
>> the
>> right direction
>>
>> import org.apache.http.client.ClientProtocolException; // cannot find
>> in
>> httpclient-android but is in original client 4.0
>> import org.apache.http.client.HttpClient; // cannot find in
>> httpclient-android but is in original client 4.0
>> import org.apache.http.client.protocol.ClientContext; // cannot find
>> in
>> httpclient-android but is in original client 4.0
>> import org.apache.http.cookie.Cookie; // cannot find in
>> httpclient-android but is in original client 4.5
>> import org.apache.http.client.CookieStore; // cannot find in
>> httpclient-android but is in original client 4.0
>> import org.apache.http.impl.client.DefaultHttpClient; // cannot find
>> in
>> httpclient-android but is in original client 4.5
>> import org.apache.http.protocol.HTTP; // cannot find
>>
>> Many thanks indeed.
>
> Those are HttpClient classes. Please use HttpClient 5.0, not just
> HttpCore 5.0
>
> Here is a HttpClient 5.0 migration guide that you may find useful.
>
> https://ok2c.github.io/httpclient-migration-guide/
>
> Oleg
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org


Sent with AquaMail for Android
https://www.mobisystems.com/aqua-mail



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: HttpClient for Android - but no HttpCore for Android

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Tue, 2019-03-26 at 01:26 +0000, Andrew Hardy wrote:
> Hi,
> 
> 
> Thank you so much for all your work in porting 
> org.apache.httpcomponents:httpclient to Android.  I appreciate the 
> benefits you are making available.  I am in the process of up
> versioning 
> some old Android code that used httpclient and I am swapping for you 
> Android port.  I have run into a little difficulty and I wonder if
> you 
> would be so kind as to help me understand where I am going wrong.
> 
> I am using the following dependancies:
> 
>      implementation 'org.apache.httpcomponents:httpclient-
> android:4.3.5.1'
>      implementation 'org.apache.httpcomponents.core5:httpcore5:5.0-
> beta7'
> 
> However, there are still 7 Classes which I used in my old code which
> I 
> cannot now find in either httpclient-android nor httpcore5, either
> same 
> named or renamed.  I would be very grateful if you could point me in
> the 
> right direction
> 
> import org.apache.http.client.ClientProtocolException; // cannot find
> in 
> httpclient-android but is in original client 4.0
> import org.apache.http.client.HttpClient; // cannot find in 
> httpclient-android but is in original client 4.0
> import org.apache.http.client.protocol.ClientContext; // cannot find
> in 
> httpclient-android but is in original client 4.0
> import org.apache.http.cookie.Cookie; // cannot find in 
> httpclient-android but is in original client 4.5
> import org.apache.http.client.CookieStore; // cannot find in 
> httpclient-android but is in original client 4.0
> import org.apache.http.impl.client.DefaultHttpClient; // cannot find
> in 
> httpclient-android but is in original client 4.5
> import org.apache.http.protocol.HTTP; // cannot find
> 
> Many thanks indeed.
> 

Those are HttpClient classes. Please use HttpClient 5.0, not just
HttpCore 5.0

Here is a HttpClient 5.0 migration guide that you may find useful. 

https://ok2c.github.io/httpclient-migration-guide/

Oleg



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: HttpClient for Android - but no HttpCore for Android

Posted by Andrew Hardy <an...@sky.com>.
Hi,


Thank you so much for all your work in porting 
org.apache.httpcomponents:httpclient to Android.  I appreciate the 
benefits you are making available.  I am in the process of up versioning 
some old Android code that used httpclient and I am swapping for you 
Android port.  I have run into a little difficulty and I wonder if you 
would be so kind as to help me understand where I am going wrong.

I am using the following dependancies:

     implementation 'org.apache.httpcomponents:httpclient-android:4.3.5.1'
     implementation 'org.apache.httpcomponents.core5:httpcore5:5.0-beta7'

However, there are still 7 Classes which I used in my old code which I 
cannot now find in either httpclient-android nor httpcore5, either same 
named or renamed.  I would be very grateful if you could point me in the 
right direction

import org.apache.http.client.ClientProtocolException; // cannot find in 
httpclient-android but is in original client 4.0
import org.apache.http.client.HttpClient; // cannot find in 
httpclient-android but is in original client 4.0
import org.apache.http.client.protocol.ClientContext; // cannot find in 
httpclient-android but is in original client 4.0
import org.apache.http.cookie.Cookie; // cannot find in 
httpclient-android but is in original client 4.5
import org.apache.http.client.CookieStore; // cannot find in 
httpclient-android but is in original client 4.0
import org.apache.http.impl.client.DefaultHttpClient; // cannot find in 
httpclient-android but is in original client 4.5
import org.apache.http.protocol.HTTP; // cannot find

Many thanks indeed.



On 21/03/2019 16:40, Oleg Kalnichevski wrote:
> On Thu, 2019-03-21 at 16:03 +0000, Andrew Hardy wrote:
>>  From my original post:
>>
>> "...HttpClient for Android uses org.apache.http.namevaluepair defined
>> in
>> HttpCore for some methods of its class URLEncodedUtilsHC4..."
>>
>> I cannot find namevaluepair in HttpClient for Android.
>>
>> So I asked:
>>
>> "...How, therefore, do I use methods of URLEncodedUtilsHC4 in Android
>> or
>> are there any alternatives? In particular the equivalent use parse
>> methods..."
>>
> org.apache.http.NameValuePair is included in the Android Platform
> (until API 28)
>
>
>>  From what you are saying I can use HttpClient 5.0 Beta and HttpCore
>> 5.0
>> Beta in Android fine, but not though Maven, right?
>>
> What stops you from using Maven with HttpCore 5.0?
>
>
>> Or maybe there's an Android library that does exactly what these
>> classes do.
>>
> That's probably the wrong list to ask about.
>
> Oleg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
>
>
> ---
> This email has been checked for viruses by AVG.
> https://www.avg.com
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: HttpClient for Android - but no HttpCore for Android

Posted by Andrew Hardy <an...@sky.com>.
I was looking here for core 5.0

https://mvnrepository.com/artifact/org.apache.httpcomponents/httpcore

Maybe I should have been looking here?

https://mvnrepository.com/artifact/org.apache.httpcomponents.core5/httpcore5

It looked like a different component, different name not just same name 
"httpcore" with s new version, and also it's Beta.



On March 21, 2019 16:40:40 Oleg Kalnichevski <ol...@apache.org> wrote:

> On Thu, 2019-03-21 at 16:03 +0000, Andrew Hardy wrote:
>> From my original post:
>>
>> "...HttpClient for Android uses org.apache.http.namevaluepair defined
>> in
>> HttpCore for some methods of its class URLEncodedUtilsHC4..."
>>
>> I cannot find namevaluepair in HttpClient for Android.
>>
>> So I asked:
>>
>> "...How, therefore, do I use methods of URLEncodedUtilsHC4 in Android
>> or
>> are there any alternatives? In particular the equivalent use parse
>> methods..."
>>
>
> org.apache.http.NameValuePair is included in the Android Platform
> (until API 28)
>
>
>> From what you are saying I can use HttpClient 5.0 Beta and HttpCore
>> 5.0
>> Beta in Android fine, but not though Maven, right?
>>
>
> What stops you from using Maven with HttpCore 5.0?
>
>
>> Or maybe there's an Android library that does exactly what these
>> classes do.
>>
>
> That's probably the wrong list to ask about.
>
> Oleg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org


Sent with AquaMail for Android
https://www.mobisystems.com/aqua-mail



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: HttpClient for Android - but no HttpCore for Android

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Thu, 2019-03-21 at 16:03 +0000, Andrew Hardy wrote:
> From my original post:
> 
> "...HttpClient for Android uses org.apache.http.namevaluepair defined
> in 
> HttpCore for some methods of its class URLEncodedUtilsHC4..."
> 
> I cannot find namevaluepair in HttpClient for Android.
> 
> So I asked:
> 
> "...How, therefore, do I use methods of URLEncodedUtilsHC4 in Android
> or 
> are there any alternatives? In particular the equivalent use parse
> methods..."
> 

org.apache.http.NameValuePair is included in the Android Platform
(until API 28)


> From what you are saying I can use HttpClient 5.0 Beta and HttpCore
> 5.0 
> Beta in Android fine, but not though Maven, right?
> 

What stops you from using Maven with HttpCore 5.0?


> Or maybe there's an Android library that does exactly what these
> classes do.
> 

That's probably the wrong list to ask about.

Oleg


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: HttpClient for Android - but no HttpCore for Android

Posted by Andrew Hardy <an...@sky.com>.
From my original post:

"...HttpClient for Android uses org.apache.http.namevaluepair defined in 
HttpCore for some methods of its class URLEncodedUtilsHC4..."

I cannot find namevaluepair in HttpClient for Android.

So I asked:

"...How, therefore, do I use methods of URLEncodedUtilsHC4 in Android or 
are there any alternatives? In particular the equivalent use parse methods..."

From what you are saying I can use HttpClient 5.0 Beta and HttpCore 5.0 
Beta in Android fine, but not though Maven, right?

Or maybe there's an Android library that does exactly what these classes do.

Thanks Oleg,

Sorry if I've confused things.

Andrew

On March 21, 2019 14:38:45 Oleg Kalnichevski <ol...@apache.org> wrote:

> On Thu, 2019-03-21 at 14:11 +0000, Andrew Hardy wrote:
>> Oleg,
>>
>>
>> I'm a bit confused.  Just to clarify.  Are you saying stock versions
>> of Apache
>> HttpClient 4.5 and 5.0 "should" run on Android anyway?  Why are you
>> doing
>> the port if that's still a possibility?
>
> 1. Apache HttpClient 4.5
>
> HttpClient 4.5 is _almost_ compatible with Android API 26 or later. The
> trouble-maker is org.apache.http.conn.ssl.DefaultHostnameVerifier that
> depends on javax.naming APIs unsupported by Android
>
> It is _incompatible_ with earlier versions of Android API (< 26) and
> there is nothing that can be done about it.
>
> My project basically replaces the DefaultHostnameVerifier class with a
> fork back-ported from Apache HttpClient 5.0 and adds a few minor
> utility classes
>
> https://github.com/ok2c/httpclient-android-ext
>
> 2. Apache HttpClient 5.0
>
> Apache HttpClient 5.0 _should_ be fully compatible with all common
> Android API versions. There used to be troubles with the logging code
> in HttpClient 5.0, so before I can declare it fully compatible I want
> to thoroughly test it.
>
>
>> Or do you mean they are "since"
>> the port and they actually support both platforms?
>>
>>
>> You say core was folded into Android client, but presumably you don't
>> mean
>> "all" of it?
>
> If my memory still serves NIO and server-side code got dropped. What is
> it that you think is missing?
>
>
>> My post is about something I didn't find to be folded in.
>>
>>
>> Finally you suggest core 5.0 should behave with Android.  I am using
>> maven
>> central and I don't see 5.0.  do you mean 5.0 beta and I have to
>> download
>> the jar and make the dependency reference the file rather than
>> remote?
>
> https://search.maven.org/artifact/org.apache.httpcomponents.core5/httpcore5/5.0-beta7/jar
>
> <dependency>
> <groupId>org.apache.httpcomponents.core5</groupId>
> <artifactId>httpcore5</artifactId>
> <version>5.0-beta7</version>
> </dependency>
>
> Hope this helps
>
> Oleg
>
>
>> Sorry.  Hope this makes sense.  I am still a novice in this area.
>>
>> Very kind regards,
>>
>> Andrew.
>>
>>
>>
>>
>>
>>
>> On March 20, 2019 14:39:27 Oleg Kalnichevski <ol...@apache.org>
>> wrote:
>>
>>> On Wed, 2019-03-20 at 00:20 +0000, Andrew Hardy wrote:
>>>> I think HttpClient for Android uses org.apache.http.namevaluepair
>>>> defined
>>>> in HttpCore for some methods of its class URLEncodedUtilsHC4.
>>>> However, I
>>>> can find no Android version of HttpCore. How, therefore, do I use
>>>> methods
>>>> of URLEncodedUtilsHC4 in Android or are there any alternatives?
>>>> In
>>>> particular the equivalent use parse methods.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Hope this makes proper sense, or maybe I have misunderstood
>>>> things.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Many thanks,
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Andrew.
>>>
>>> Hi Andrew
>>>
>>> HttpCore code got folded into Android distribution of HttpClient
>>> for
>>> the sake of simplicity.
>>>
>>> I am presently working on making sure that stock versions of Apache
>>> HttpClient 4.5 and 5.0 could be run on Android without any
>>> modifications but I have been doing all this work outside ASF as my
>>> own
>>> personal project.
>>>
>>> In your case I would just recommend using Apache HttpCore 5.0 which
>>> should just work on Android out of the box.
>>>
>>> Cheers
>>>
>>> Oleg
>>>
>>>
>>> -----------------------------------------------------------------
>>> ----
>>> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
>>> For additional commands, e-mail: dev-help@hc.apache.org
>>
>>
>> Sent with AquaMail for Android
>> https://www.mobisystems.com/aqua-mail
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
>> For additional commands, e-mail: dev-help@hc.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org


Sent with AquaMail for Android
https://www.mobisystems.com/aqua-mail



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: HttpClient for Android - but no HttpCore for Android

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Thu, 2019-03-21 at 14:11 +0000, Andrew Hardy wrote:
> Oleg,
> 
> I'm a bit confused.  Just to clarify.  Are you saying stock versions
> of Apache
> HttpClient 4.5 and 5.0 "should" run on Android anyway?  Why are you
> doing 
> the port if that's still a possibility?

1. Apache HttpClient 4.5 

HttpClient 4.5 is _almost_ compatible with Android API 26 or later. The
trouble-maker is org.apache.http.conn.ssl.DefaultHostnameVerifier that
depends on javax.naming APIs unsupported by Android

It is _incompatible_ with earlier versions of Android API (< 26) and
there is nothing that can be done about it.

My project basically replaces the DefaultHostnameVerifier class with a
fork back-ported from Apache HttpClient 5.0 and adds a few minor
utility classes 

https://github.com/ok2c/httpclient-android-ext

2. Apache HttpClient 5.0

Apache HttpClient 5.0 _should_ be fully compatible with all common
Android API versions. There used to be troubles with the logging code
in HttpClient 5.0, so before I can declare it fully compatible I want
to thoroughly test it. 


>   Or do you mean they are "since" 
> the port and they actually support both platforms?
> 
> You say core was folded into Android client, but presumably you don't
> mean 
> "all" of it?

If my memory still serves NIO and server-side code got dropped. What is
it that you think is missing? 


>   My post is about something I didn't find to be folded in.
> 
> Finally you suggest core 5.0 should behave with Android.  I am using
> maven 
> central and I don't see 5.0.  do you mean 5.0 beta and I have to
> download 
> the jar and make the dependency reference the file rather than
> remote?
> 

https://search.maven.org/artifact/org.apache.httpcomponents.core5/httpcore5/5.0-beta7/jar

<dependency>
  <groupId>org.apache.httpcomponents.core5</groupId>
  <artifactId>httpcore5</artifactId>
  <version>5.0-beta7</version>
</dependency>

Hope this helps

Oleg


> Sorry.  Hope this makes sense.  I am still a novice in this area.
> 
> Very kind regards,
> 
> Andrew.
> 
> 
> 
> 
> 
> 
> On March 20, 2019 14:39:27 Oleg Kalnichevski <ol...@apache.org>
> wrote:
> 
> > On Wed, 2019-03-20 at 00:20 +0000, Andrew Hardy wrote:
> > > I think HttpClient for Android uses org.apache.http.namevaluepair
> > > defined
> > > in HttpCore for some methods of its class URLEncodedUtilsHC4.
> > > However, I
> > > can find no Android version of HttpCore. How, therefore, do I use
> > > methods
> > > of URLEncodedUtilsHC4 in Android or are there any alternatives?
> > > In
> > > particular the equivalent use parse methods.
> > > 
> > > 
> > > 
> > > 
> > > Hope this makes proper sense, or maybe I have misunderstood
> > > things.
> > > 
> > > 
> > > 
> > > 
> > > Many thanks,
> > > 
> > > 
> > > 
> > > 
> > > Andrew.
> > 
> > Hi Andrew
> > 
> > HttpCore code got folded into Android distribution of HttpClient
> > for
> > the sake of simplicity.
> > 
> > I am presently working on making sure that stock versions of Apache
> > HttpClient 4.5 and 5.0 could be run on Android without any
> > modifications but I have been doing all this work outside ASF as my
> > own
> > personal project.
> > 
> > In your case I would just recommend using Apache HttpCore 5.0 which
> > should just work on Android out of the box.
> > 
> > Cheers
> > 
> > Oleg
> > 
> > 
> > -----------------------------------------------------------------
> > ----
> > To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> > For additional commands, e-mail: dev-help@hc.apache.org
> 
> 
> Sent with AquaMail for Android
> https://www.mobisystems.com/aqua-mail
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: HttpClient for Android - but no HttpCore for Android

Posted by Andrew Hardy <an...@sky.com>.
Oleg,

I'm a bit confused.  Just to clarify.  Are you saying stock versions of Apache
HttpClient 4.5 and 5.0 "should" run on Android anyway?  Why are you doing 
the port if that's still a possibility?  Or do you mean they are "since" 
the port and they actually support both platforms?

You say core was folded into Android client, but presumably you don't mean 
"all" of it?  My post is about something I didn't find to be folded in.

Finally you suggest core 5.0 should behave with Android.  I am using maven 
central and I don't see 5.0.  do you mean 5.0 beta and I have to download 
the jar and make the dependency reference the file rather than remote?

Sorry.  Hope this makes sense.  I am still a novice in this area.

Very kind regards,

Andrew.






On March 20, 2019 14:39:27 Oleg Kalnichevski <ol...@apache.org> wrote:

> On Wed, 2019-03-20 at 00:20 +0000, Andrew Hardy wrote:
>> I think HttpClient for Android uses org.apache.http.namevaluepair
>> defined
>> in HttpCore for some methods of its class URLEncodedUtilsHC4.
>> However, I
>> can find no Android version of HttpCore. How, therefore, do I use
>> methods
>> of URLEncodedUtilsHC4 in Android or are there any alternatives? In
>> particular the equivalent use parse methods.
>>
>>
>>
>>
>> Hope this makes proper sense, or maybe I have misunderstood things.
>>
>>
>>
>>
>> Many thanks,
>>
>>
>>
>>
>> Andrew.
>
> Hi Andrew
>
> HttpCore code got folded into Android distribution of HttpClient for
> the sake of simplicity.
>
> I am presently working on making sure that stock versions of Apache
> HttpClient 4.5 and 5.0 could be run on Android without any
> modifications but I have been doing all this work outside ASF as my own
> personal project.
>
> In your case I would just recommend using Apache HttpCore 5.0 which
> should just work on Android out of the box.
>
> Cheers
>
> Oleg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org


Sent with AquaMail for Android
https://www.mobisystems.com/aqua-mail



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: HttpClient for Android - but no HttpCore for Android

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Wed, 2019-03-20 at 00:20 +0000, Andrew Hardy wrote:
> I think HttpClient for Android uses org.apache.http.namevaluepair
> defined 
> in HttpCore for some methods of its class URLEncodedUtilsHC4.
> However, I 
> can find no Android version of HttpCore. How, therefore, do I use
> methods 
> of URLEncodedUtilsHC4 in Android or are there any alternatives? In 
> particular the equivalent use parse methods.
> 
> 
> Hope this makes proper sense, or maybe I have misunderstood things.
> 
> 
> Many thanks,
> 
> 
> Andrew.
> 

Hi Andrew

HttpCore code got folded into Android distribution of HttpClient for
the sake of simplicity.

I am presently working on making sure that stock versions of Apache
HttpClient 4.5 and 5.0 could be run on Android without any
modifications but I have been doing all this work outside ASF as my own
personal project.

In your case I would just recommend using Apache HttpCore 5.0 which
should just work on Android out of the box.

Cheers

Oleg


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org