Java – Android: what is the best HTTP library for uploading images to the server?

There are many libraries available, but which is better for image upload? Who knows which library instagram uses?

I've tried volleying before, but it's not good

This is popular“

AndroidAsync – https://github.com/koush/AndroidAsync

android-async-http – https://github.com/loopj/android-async-http

okhttp – https://github.com/square/okhttp

HTTP request – https://github.com/kevinsawicki/http-request

android-volley – https://github.com/mcxiaoke/android-volley

Ions – https://github.com/koush/ion

Transformation – https://github.com/square/retrofit

Bolt Android- https://github.com/BoltsFramework/Bolts-Android

thank you

resolvent:

The libraries you mentioned are very different in nature. They can be grouped more or less like this

Socket level API:

This includes

> AndroidAsync > okhttp > HttpClient > HttpURLConnection

These are very low - level APIs that focus on how to send packets through sockets and optimization

Among them, Android 23 now uses okhttp internally. Okhttp has existed for a long time, which makes it my favorite socket API

Higher level APIs:

These APIs are designed to help developers develop faster and easy to use. They are usually used as a wrapper for socket level APIs. This is the relationship between them

>Transformation – okhttp > Android async http – httpclient > ion – androidasync > bolts Android – not sure about its foundation > volley * – depending on the API level, httpurlconnection / httpclient in the system library

Image loading API:

Volley is a special API. It is an advanced API, but it has another usage, image loading. These types of APIs include the following:

>Volleyball > Picasso > mural > gliding

Conclusion:

For your solution, I believe you are looking for advanced APIs. However, it is difficult to recommend the best API, which will depend on usage and personal preferences

As an advanced API, volley was * is not very good and does not include several functions, such as HTTPS and data stream upload. I suggest you start looking for the best library for your project, starting with retrofit, ion and bolts

*I haven't tried volley, because I used it in the first year of its release, it may have changed

Edit:

I just installed the instagram app and checked their open source libraries section. They already include Android async HTTP, which may mean that they use it for HTTP requests

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>