on 09-18-2014 3:57 PM
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 ?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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);
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.