cancel
Showing results for 
Search instead for 
Did you mean: 

Smp 3.0 sp03 Offline Caching Issue in Android App

Former Member
0 Kudos

After I apply GET request for a URL in Android app, I use mergeEntries to update cache for entries but I realized that cache.mergeEntries method just updates server cache, not a local cache.

Also, cache.readEntriesLocal method just gives me entries that are added by cache.addEntry(entry)

Is there any way to fill up local cache with all server entries after GET request ?

Accepted Solutions (1)

Accepted Solutions (1)

jangold
Explorer
0 Kudos

Hi Serkan,

there is no method in SDK libraries, that will help you with such action.

If you really need to save all entries from your server cache to your local cache, you will need to do it by your self.

How?

After you save entries from GET request use Cache#readEntriesServer (reed all entries from server cache) and then Cache#addEntry (store the entries into local cache).


Just let me ask you why do you need this?

Do you use delta token?


Regards,

Jan Gold

Answers (1)

Answers (1)

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Serkan,

Did you get a chance to go through this guide.?

Regards

JK

Former Member
0 Kudos

Hi Jitendra,

Thanks for your answer. However we are not using Kapsel in our Android app. We just try to develop native OData application that supports both online and offline mode. Thats why we follow these steps http://help.sap.com/saphelp_smp303sdk/helpdata/en/7c/0b0f9070061014a7b1c78f0f331130/content.htm?fram...

How can local cache be filled up with all server entries because cache.readEntriesLocal method just returns entries which are added to local cache. I mean local cache needs a method like mergeEntries to update local cache entries as well after GET operation.

Here you can see part of our code. While entries_server param has 11 entries, entries local has just 1 entry. We want to put all 11 entries in local cache too.

IODataFeed feed = parser.parseODataFeed(responseString, "ZmbSGroupSet('GRUP_1')/Members", schema);

cache.mergeEntries(feed, Global.getAppEndPoint() + "ZmbSGroupSet('GRUP_1')/Members");

Entries_server = cache.readEntriesServer(Global.getAppEndPoint() + "ZmbSGroupSet('GRUP_1')/Members");

Entries_local = cache.readEntriesLocal("ZmbSGroupSet('GRUP_1')/Members", null);

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

Have a look at