2

I do not know how I can solve the following doubt, I have a GET request from my API and of course, I would like to save the parameters obtained in the application and not have to make every time I browse each activity a new GET request, as it would overload the server by the over-requests requested. What is the correct way to keep this temporary data while using the app?

My idea is that as soon as the application loads, an Activity SPLASH is shown and this same SPLASH, performs the API request and from here the data is kept. How should the implementation be done?

Fumatamax
  • 149
  • 6
  • Depends on the situation. If there's a *ton* of data, the application would start hogging the memory. If the data to be stored is simple like key-value pairs, a simple `HashMap` would do. The best way though is to cache requests on a reverse proxy. – happy-san Jul 15 '21 at 15:41
  • https://stackoverflow.com/questions/14026041/best-way-to-cache-restful-api-results-of-get-calls – happy-san Jul 15 '21 at 15:43
  • Initially there is not a ton of data. It's simpler data as you say key-value data. It may have some 70 lines of code, but it is simple data. I will look at what you have passed me and see if I solve my doubt, thanks. @happy_san – Fumatamax Jul 15 '21 at 19:19

0 Answers0