1

I'm following the instructions on the Kinvey Android Caching and Offline guide. I have just changed one instance of an AsyncAppData object to use the CACHEFIRST cache policy with an InMemoryLRUCache and the LOCAL_FIRST offline policy with a SqlLiteOfflineStore. I was expecting to observe a typical delay of a couple of seconds to populate the data in my adapter on the first time after making this change, and then observe an essentially instant population of that data if it needed to be repopulated, for example if I changed the orientation of my device (which causes the data to reload). However, I didn't observe any difference in speed at all, leading me to believe that neither the cache or offline store are working.

So, as a first step to understanding this problem, I wanted to know if there is any way, either via logcat or any other way, to actually tell where the data I've got has come from, ie. from the cache, offline store or online.

Dan
  • 125
  • 6

1 Answers1

1

Hey I'm an engineer at Kinvey working on the Android library and can help you out.

The quickest way to test offline and caching is to just turn on airplane mode and retry the request-- if you get results, then it is pulling them locally.

For Offline, there are a handful of log messages that can help you determine the behavior-- the log messages begin with "offline", such as "offline execution - device is online" or "offline get" or "offline queueing request"

Let me know if that helps!

edthethird
  • 6,263
  • 2
  • 24
  • 34