Any progress on Android support?

已查看 311 次
跳至第一个未读帖子

Konrad Malawski

未读,
2011年5月7日 16:08:502011/5/7
收件人 asyncht...@googlegroups.com
Hi,
I really love your library but it sadly doesn't seem to be compatible with Android devices. It's falling back to the JDK implementation, which obviously isn't supported on the DVM.

05-07 19:44:34.990: ERROR/AndroidRuntime(262): java.lang.VerifyError: com.ning.http.client.providers.jdk.JDKAsyncHttpProvider
        at com.ning.http.client.AsyncHttpClient.loadDefaultProvider(AsyncHttpClient.java:555)
        at com.ning.http.client.AsyncHttpClient.<init>(AsyncHttpClient.java:180)
        at com.ning.http.client.AsyncHttpClient.<init>(AsyncHttpClient.java:162)

I saw your discussion at https://groups.google.com/forum/#!topic/asynchttpclient/Ml6bOndZbDY but sadly it didn't have a solution. If you have an idea on how to fix this, please let me know - I'm currently playing around with other *AsyncHttpProvider's - hopefully something nice will come out of it. The ApacheAsyncHttpProvider also seems to fail, I have not yet been able to try out the Netty implementation - will do so in a few hours. Could you suggest any nice way out of this situation? The other project (project Android is using OtherProject which is using AsyncHttpClient) which is using AsyncHttpClient is also my opensource code, so if making it work on Android is a problem I'll switch over to some other provider - but would very much like to stay with your lib - as I already said, it's just great... :-)

In the worst case scenario I would have to implement my own AsyncHttpProvider I guess, but that's not really something I would like to do now.
I'm open to any suggestions and ideas.

-- 
Thanks a lot in advance,
Konrad

jfarcand

未读,
2011年5月9日 08:09:292011/5/9
收件人 asyncht...@googlegroups.com
Salut,

I've never worked with Android so I will need some help in order to
diagnose the issue. Can you try to create the JDKAsyncHttpProvider
directly instead of letting the library creates it?

AsyncHttpClient c = new AsyncHttpClient(new JDKAsyncHttpProvider(new
AsyncHttpClientConfig.Builder().build()));

Thanks!

-- Jeanfrancois

> --
> You received this message because you are subscribed to the Google
> Groups "asynchttpclient" group.
> To post to this group, send email to asyncht...@googlegroups.com.
> To unsubscribe from this group, send email to
> asynchttpclie...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/asynchttpclient?hl=en.

Konrad Malawski

未读,
2011年5月9日 18:14:152011/5/9
收件人 asyncht...@googlegroups.com
Hi and thanks for your response.

Yes I tried it like you suggested (tried it again just now to be sure), it results in:

05-09 22:04:48.857: ERROR/AndroidRuntime(288): Uncaught handler: thread main exiting due to uncaught exception
05-09 22:04:48.867: ERROR/AndroidRuntime(288): java.lang.VerifyError: com.ning.http.client.providers.jdk.JDKAsyncHttpProvider
        at pl.llp.kanbanery.guice.JanbaneryProvider.getRestClient(JanbaneryProvider.java:46)
        at pl.llp.kanbanery.guice.JanbaneryProvider.get(JanbaneryProvider.java:32)
        at pl.llp.kanbanery.guice.JanbaneryProvider.get(JanbaneryProvider.java:18)

In the end I just switched my high level "RestClient" which does some additional things to the http client implementation that is native to Android, that is to the packages -> org.apache.http.* (org.apache.http.impl.client.DefaultHttpClient).
So if we'd be able to implement an AsyncHttpProvider using the DefaultHttpClient from Apache, AsyncHttpClient would probably get it's Android support :-) I may research this further in some freetime hmm... If I come up with an implementation I'll be sure to let you know about it :-)
My basic implementation is enough for now for me, I didn't really harness the async part of your library in this project yet so a simple implementation was easy to swap in.

--
Thanks a lot for your response and good work on AHC :-)
Konrad

jfarcand

未读,
2011年5月10日 08:22:082011/5/10
收件人 asyncht...@googlegroups.com
Salut,

On 11-05-09 6:14 PM, Konrad Malawski wrote:
> Hi and thanks for your response.
>
> Yes I tried it like you suggested (tried it again just now to be sure),
> it results in:
>
> 05-09 22:04:48.857: ERROR/AndroidRuntime(288): Uncaught handler: thread
> main exiting due to uncaught exception
> 05-09 22:04:48.867: ERROR/AndroidRuntime(288): java.lang.VerifyError:
> com.ning.http.client.providers.jdk.JDKAsyncHttpProvider
> at
> pl.llp.kanbanery.guice.JanbaneryProvider.getRestClient(JanbaneryProvider.java:46)
> at pl.llp.kanbanery.guice.JanbaneryProvider.get(JanbaneryProvider.java:32)
> at pl.llp.kanbanery.guice.JanbaneryProvider.get(JanbaneryProvider.java:18)

Thanks for sharing. I've filled:

https://issues.sonatype.org/browse/AHC-91

to track the issue. I've never developped with Android so I will need a
couple of days to install the dev env and see wha


>
> In the end I just switched my high level "RestClient" which does some
> additional things to the http client implementation that is native to
> Android, that is to the packages -> org.apache.http.*
> (org.apache.http.impl.client.DefaultHttpClient).
> So if we'd be able to implement an AsyncHttpProvider using the
> DefaultHttpClient from Apache, AsyncHttpClient would probably get it's
> Android support :-) I may research this further in some freetime hmm...
> If I come up with an implementation I'll be sure to let you know about
> it :-)

Thanks!

> My basic implementation is enough for now for me, I didn't really
> harness the async part of your library in this project yet so a simple
> implementation was easy to swap in.
>
> --
> Thanks a lot for your response and good work on AHC :-)

Thanks! Let me know how it goes!

-- Jeanfrancois

Konrad Malawski

未读,
2011年5月10日 09:04:042011/5/10
收件人 asyncht...@googlegroups.com
Thanks for opening the issue on jira, good idea.
I'll try to implement it some time after GeeCON which is taking place this week and I'm very much involved there as an organizer so won't have any time this week to hack around...

Anyways, let's continue about this matter in the jira issue, thanks again for your quick responses :-)

--
Konrad

emanuele

未读,
2011年7月5日 04:38:202011/7/5
收件人 asynchttpclient
Any progress supporting async http client on android? what about the
pipelining support?

Thanks and sorry for bothering u

jfarcand

未读,
2011年7月6日 11:22:352011/7/6
收件人 asyncht...@googlegroups.com
Salut,

I'm not longer full time on this project (specially for the next 3
months)...hence if you need support, you will need to submit patches :-) :-)

Any contribution welcomed!

Thanks!

-- Jeanfrancois

回复全部
回复作者
转发
0 个新帖子