Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8524

Re: SMP 3.0 OData Offline Create/Update/Delete

$
0
0

Hi Valentin,

 

Let's try to discard problems with the credentials.

 

 

I missed one thing in this How To... On-board users with SMP 3.0 OData SDK (Android) guide. If you are using the LogonCore class to register the user with SMP, when the registration finishes and if it is successful, you need to call a method in the LogonCore class that is called persistRegistration. This method stores the data from the logon context to the data vault.

 

With the credentials persisted, you would need to implement the UsernamePasswordProvider interface. I believe there's a sample of this class in the project you downloaded from SAP/sap_mobile_native_android at solution · GitHub It should be in the online package and it's called "CredentialsProvider.java". let me know if you cannot find it.

 

Currently the UsingOfflineAPI sample app configures the HTTPConversationManager with the LogonConfigurator. This is valid ONLY when you are using MAF Logon component

 

  IManagerConfigurator configurator = LogonUIFacade.getInstance().getLogonConfigurator(context);

  HttpConversationManager manager = new HttpConversationManager(context);

  configurator.configure(manager);

 

You are not using MAF Logon component, so you would need to configure the HTTPConversationManager with your custom UsernamePasswordProvider class.

 

For example:

 

CredentialsProvider credProvider = CredentialsProvider.getInstance(lgCtx);

             HttpConversationManager manager = new CommonAuthFlowsConfigurator(context).supportBasicAuthUsing(credProvider).configure(new HttpConversationManager(context));

 

  ODataOfflineStoreOptions options = new ODataOfflineStoreOptions();

  options.host = url.getHost();

  options.port = String.valueOf(url.getPort());

  options.enableHTTPS = lgCtx.isHttps();

  options.serviceRoot= endPointURL;

  options.conversationManager = manager;

...

 

Question3: How are you opening the offlinestore?


Suggestion: Another thing you can try is to look for synchronization errors. There are 2 ways to detect errors during flush:

1. errors are recorded in the ErrorArchive, which is returned to the client device as an OData feed. The application can obtain the body of the original request and allow the user to re-submit the operation.

2. The application receives notification of these errors through the Request Failure Listener (Android).


Please have you look at this guide that explains how to access errors during synchronization How to... Handle Synchronization Errors (Android)

 

Best regards

Claudia


Viewing all articles
Browse latest Browse all 8524

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>