Android App Development
iOS App Development
Flutter App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 3.0.3.7 release ready!
Deniel Kerr
Founder. Opencart
Top Partners
Retrofit 2 is one the best library I have used it so far. There are many cases in which we can use custom callback for our response callback such as Error Handling, Response Handling, Custom Response and much more.
By using a custom callback or any piece of custom code in an application we are promoting object oriented design pattern and thus reducing your efforts that are needed/mandatory to follow if not using it.
Here is an example of Custom Callback that is used to handle error , hide dialog and return response data to original callback.
By using Custom Callback, we are preventing from extra effort required to handle error in each request. Plus, we can perform custom operation that are required whenver the response is recieved. In this case we are just hidding the AlertDialog.
We can use this callback instead of our existing callback. e.g.
And Here is the original callback which gets called from our Custom RetrofitCallback
That’s all it take for laziness!
Your email address will not be published. Required fields are marked*
Name*
Email*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
We use cookies to personalize your experience. By continuing to visit this website you agree to our use of cookies. Learn more about privacy policy
All communication is done through a ticket system. I appreciate the regular almost daily updates of what is being worked on, and communicating changes or updates is easy through this system. Mobikul's response timeframe is quick.
Josh Arnold
Owner, Shop ATV Escape
USA
India
Global
Name
Email
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.