5

I'm confused in finding a better way to implement:

1) data caching, as I am fetching data from rest APIs by executing AsyncTask in every fragment say 3-4 times, what I want is to reload the data from cache instead of calling the AsyncTask again.

2) a way to deal with configuration changes events... such as orientation change or some other events.

confusion: are DATA Caching and onconfiguration changes related at all somehow? If so, does only caching code can serve the purpose for both issues?

What I've tried : here's a project that does the magic for onconfiguration changes part and this library project can serve the data caching purpose

or should i use the volley library as recommended in google io 2013?

My MODEL: I am having 1 ACTIVITY that controls and seven other specific fragments that does the execution part. Please type your words if you've any kind of idea how to proceed?

a.ch.
  • 8,285
  • 5
  • 40
  • 53
inderbagga
  • 1,008
  • 1
  • 9
  • 18
  • 1
    Well, data caching is basically temporarily saving data to the hard drive. Configuration changes cause the activity to get destroyed and re-created. If you want to know the different ways to persist the data in that situation, google "android persistent data storage". – Rick Falck Dec 05 '13 at 08:11

1 Answers1

0

Loaders may totally satisfy your needs. If not, consider using LruCache.

Jon Willis
  • 6,993
  • 4
  • 43
  • 51
a.ch.
  • 8,285
  • 5
  • 40
  • 53