cancel
Showing results for 
Search instead for 
Did you mean: 

OData Offline capabilities in GWPA Starter Kit Apps?

markteichmann
Product and Topic Expert
Product and Topic Expert
0 Kudos

I created a native iOS Workflow App using the GWPA Starter Kit.

When I launch the app on an iOS Device I see the following log:


Unable to instantiate Cache...Delta Link and CSRF(Offline) handling not possible

Now I wonder if I can somehow extend the generated code for including offline functionality as described here? Or do I have to write all generated code by myself if I like to use OData offline?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

the first question I think you have to ask yourself is :

does your SAP NW Gateway and the service your app is consuming itself support delta querying ? Offline capability with incremental updates uses Delta Queries on the gateway side. These can only be achieved when your Gateway has the correct SP level and also provided the service you are invoking supports it.

In order to enable delta queries, please consult : http://scn.sap.com/docs/DOC-47043

There is an alternative way for enabling delta queries by reusing some of the Syclo Agentry framework components in the backend system. For that approach please consult : http://scn.sap.com/docs/DOC-49290

Hope it helps.

bradp
Active Participant
0 Kudos

Hi Mark,

I'm actually busy figuring this out at the moment and have generated the app from the GWPA.

To answer your question: No, the GWPA does not by default include the code and libraries needed for offline capabilities. You do need to manually add some libraries and code.

I have managed to get the "Caching" (Offline storage) side of it working via the Cache API. It did require adding a few things in:

1. Add in the libCache.a library

2. Add iOS Core Data library

3. Add Cache.bundle to your application

You will find the libCache.a and Cache.bundle in the SMP3SDK if you are on SMP3.0 ramp-up.

Then you need to do some manual coding to get the caching working:

1. Initialise the Cache on app startup.

2. On read request response, merge to cache

3. Read you data from the cache instead of the request response once merged into the cache

The Request Queuing side of things is where I am having major difficulties. It seems as if when you enable offline Queuing via the RequestBuilder Class, when you call on the method in the SDMConnectivityHandler class to execute the request, it crashes. The latest SDMConnectivity class is now included in the libGWConsumption.a library, which makes it non editable and hard to debug. So my thoughts are, there may be a bug in there around Offline Request Queuing. As when I write up my own code for generating the request, it seems to get a little further.

I'm almost there getting it to work, only problem I'm having is the selector is not being called when performing a request offline. But it does automatically trigger the request next time I startup the app, which is a good thing.

Im busy documenting this all and building a sample/demo app with offline capabilities, so IF or WHEN, I get this working I will post it all on a blog.

Hope that helps you a bit for now.

Cheers,

Brad

markteichmann
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Brad,

thank you for this detailed answer. I had hoped that it would be easier to adapt the generated code for offline support. But maybe it is better to build something from scratch anyway in order to get a real understanding of the whole mechanism.

Hopefully there will be some RKT documents available soon. This would be far quicker than having to try and error every tiny step by yourself.

I am looking forward to see if you get along with this and hopefully I also have something to blog about in the future regarding SMP3 and OData.

Regards,

Mark

bradp
Active Participant
0 Kudos

Hi Mark,

No problem. Unfortunately figuring out how to use the new functionality is far from easy. I am still stuck on the Offline Queue functionality and cant quite figure out if I have done something wrong or if the new SDK's are just real buggy at the moment. Not quite sure where to ask.....maybe post a question in the ramp-up, or oss note, not to sure how it works.

I also decided to have a look at the Android side of the SDK's which I have previously worked on a fair amount with version 2.2.4. And to my surprise, it looks like they have totally rewritten almost everything. so much that if I had to migrate my app to SMP 3.0 SDK's it would most certainly not be a simple thing. One of the consequences of being an early adopter I guess. It doesn't really surprise me that most companies are delaying adopting this technology until such a time that it stabilizes and people can see that it has matured to an extent that it wont become deprecated a week after adopting it .

Despite my frustration with this, I do think its going in the right direction, however it still has a long way to go. For one, the "Offline Capabilities", although they're better than not having any, they still aren't a full blown solution for all offline scenarios as it is predominantly geared towards simple scenarios, which is fine in terms of a workflow app, but will not really be ideal for anything that requires more complex database capabilities.

In the mean time I'm going to continue to bang my head against my desk until I can get this to work.

Cheers,

Brad

Former Member
0 Kudos

Hi,

Are you Able to figure out..please share documentation

Regards

Answers (0)