Reputation: 11
I am handling a lot of internet request in my android application so I want to make a volley request inside a method and return the result of request in order to write less code So that every time I need to make a request I will call the method. Is this a good way or not? if so how to implement this method ?
Upvotes: 1
Views: 204
Reputation: 726
Having one point of entry and exit for all Network requests is not necessarily a bad implementation, though it does make your application tightly coupled and riddled with unnecessary parameters.
That said, It is not a 'wrong implementation'. Just, not scalable maybe.
Refer Google's official documentation here. Scroll down to the heading Example: GsonRequest
. That should answer your question.
Upvotes: 1