Q:

Best way to send lots of events to server in android

I want to send a lot of user events in Json format to my server for analytics purpose in android app. Sending so many events by firing a post retrofit method and waiting for a call back slows down the application. I am making calls asynchronously but still app is slowing down due to this. 
Is there a better way to send these requests? An optimized way I can send data. Maybe not even checking for callback response. Is it possible to do that with retrofit 2.0 or Okhttp. 

A:

You may want to consider caching data into manageable "Data buckets" on the mobile phone (which could be of some standard minimum size says (at least) 50/100/200 records or whichever makes sense) before firing a server post event.
That way - you avoid making multiple calls and strain your server/mobile.
Okhttp or any other library might not directly help you implement this logic, but you could write your own logic and use these libraries that just simplify your calls and management of call failures.

