Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
The community reviewed whether to reopen this question 8 months ago and left it closed:
Original close reason(s) were not resolved
Improve this question
I am trying to implement a code which makes intial get/post request to fetch the data then using that data i m going to fetch download links with jsoup.
file are n't greater than 200 kbs
so which is better to do this task?
1)intial request
2)downloading files
How to chose between: Volley and Retrofit
If you are :
Making Requests then I would like to say though both frameworks are capable of the same outcome, Retrofit is capable of accomplishing this without customization. However, if you are implementing multiple requests within your application, and I suspect you are, customization may be necessary within Retrofit. Though that could be the case, at the simplest level Retrofit has the easier solution.
Downloading Files(Image): Being able to make file requests was a pretty large factor in the making of our decision. Volley comes packaged with a loader specifically designed to download images for you. Packaged along with the loader is a custom view called the NetworkImageView in which the developer only has to hand a URL and an ImageLoader to and Volley does the rest. This view is specifically targeted to work well with list views and allow for automatic cancellation of requests when the images parent view is destroyed. On the contrary, Retrofit does not easily support image downloads. To accomplish what we are able to with Volley, one would be required to download and include another library in your project such as Picasso. So here Volley is a better solution.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I presently use volley for network calls.
But, Google doesn't seem to be actively maintaining volley.
I heard that google initially developed volley to use it for its play store app but they haven't mentioned it in their list of 3rd party libraries used.
Almost everyone uses Retrofit(looking at the benchmarks, Retrofit seems better option), is it time to quit using volley?
p.s: please don't post the pros and cons of volley and retrofit
Google doesn't seem to be actively maintaining volley
That depends entirely on how you define "actively maintaining". Development is ongoing, as you can see by looking at the Volley git repo, which shows many commits over the past year (as of the time of this writing).
Google also shipped an official Volley artifact earlier this year, as version 1.0.0.
but they haven't mentioned it in their list of 3rd party libraries used
Google wrote the Play Store app. Google wrote Volley. Hence, from Google's standpoint, Volley is not a third-party library. For anyone other than Google, Volley is a third-party library.
Almost everyone uses Retrofit
Retrofit is not equivalent to Volley. The triad of Square HTTP libraries (OkHttp3, Retrofit, Picasso) would be equivalent to Volley, and that combination exceeds Volley's capabilities.
Based on questions here at Stack Overflow, I do not believe that "almost everyone uses Retrofit".
is it time to quit using volley?
Nobody can answer that other than you. You are the one with decision criteria of importance to you. You are the one who needs to evaluate which libraries meet those criteria.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I know two of it can be used to send http request and get the response from the server, then we can parse into Json object if we want. So:
Which is the best way to send request and get response from the server, Retrofit 2 or HttpUrlConnection?
Which is advantage and disadvantage between them?
Retrofit 2 and Volley are both great networking libraries for modern Android apps, but each has its own strengths that are worth weighing for critical projects. Use Retrofit if your use-case is a standard REST API with JSON responses and not too many custom requirements in terms of caching, request prioritization, retries, etc. Use Volley if you have unusual / fine-grained requirements, or if you anticipate needing a lot of flexibility from your networking layer in the future at the cost of more code. Use neither if you're downloading large files or streaming -- for that, use DownloadManager instead.
Note: HttpClient is deprecated Now
Need More, Find it here
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I am already aware of the advantanges of retrofit and have used it in many scenerios. For a particular application , I need to call only 1 login API which will do authentication.
I am not sure if the advantages of retrofit are worth it for only one API. or is it a overhead and I should Http for sake of simplicity
If it is just a single request, then I'd say go with the simplest/lightest approach. But these things tend to evolve with time, therefore you are likely to find yourself in a position of adding another one, then another one...
Remember - networking mechanism is not an architectural decision. In fact, your application should not care what networking mechanism is being used - it should depend on a general interface that you define. You could start with implementing this interface using the simplest approach, and add a more complex implementation in case your networking requirements evolve. You could also implement several approaches and benchmark them...
So, whatever approach you choose, I recommend not to "pollute" your business logic with networking logic, but hide it behind interface. This way even if you make the wrong decision now, it will be a matter of few hours to fix it later.
For a single API call http is fine. As you know using library with your application is going to occupy user phone space when they install your application on their device. so for a single call, you are good to go with async task.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I did some research on Google Volley and found that it is somewhat easy and clean to use.
But I am still not sure as to what the advantages of using it are and whether I should still use the AsyncTask.
I know AsyncTask works as a background task and that it is separate but what about Volley?
Which one should I opt for?
This is mainly an opinion based question that is largely dependent on the needs of your particular application. Volley provides a lot of things for you out of the box, like network caching (assuming you're given correct cache headers from your server), and an easy to use API with all of your callbacks and different threading layers handled for you. So, it really depends on what you're looking. Personally, I think any production worthy application should use some sort of networking library that a team has spent plenty of time patching and prepping for you (rather than trying to reinvent the wheel), and since a Google team has gone through the trouble for doing this for you...why not?
One cannot compare Volley with an AsyncTask.
So your question makes no sense.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
Im gonna start a project on android.
It will be car selling.
1st, which libraries do I need for interface? Functionality I need is
1)Images in grid blocks on whole screen.
2)Images zooming.
And 2nd, I have to connect my app with xml or json file that will contains cars with infos and image. The server that will output xml (or json) file with cars is already done.
How I could parse that xml and json? The easiest way to connect that base to app?
For the grid you can use the standard GridView included in the SDK. To load images, I like to use Picasso and for out of the box pinch to zoom and double tap zoom I use PhotoView.
To retrieve and create the JSON object you can use Volley or AsyncHttpClient. You can also use Volley for the image loading, but I find Picasso a little more convenient.
Unless there's already a client built for your particular web service, you will have to parse the JSON or XML yourself, using appropriate classes from the SDK (look up JSONObject and XMLPullParser).
I hope that answers your questions.