Sick of your mobile apps hanging or being totally unusable when they don't have a connection? Tired of waiting for an app to download data and then having to constantly refresh it? Got a mission critical app which would be ideal for mobile but not sure how you're going to deal with update errors when two people attempt to sync the same updated record back to HQ systems?
With the February 2016 update to MCS we've revamped the API so the actual programming effort mobile developers need to put into this problem isn't a depressing complex mess of code you have to write yourself, rather it is, well, a doddle. Let's investigate.
Having created a server side custom or storage API, the mobile developer has to do only 3 things: install the MCS mobile client SDK for Android, iOS or Windows, configure the sync policies to state their preferences around fetching data from the device's local cache or remote server side APIs, and then write the client side code using the SDK to initialize the sync engine and fetch the data in just a few lines of code.
The sync policies are the magic of the MCS data offline & sync capabilities. These options save the mobile developer from a complex programming problem and considering numerous offline use cases & sync edge cases. Rather it is replaced with a list of simple but powerful policy options to choose from, which along with the SDK provided by Oracle takes care of the grunt work of data sync between the mobile client and server.
As example imagine a MCS server side custom API for working with incident reports. In building support into your mobile app to synchronize data with the remote incidents API published via MCS, you make decisions like the following:
The following example demonstrates the choices from above using the sync policy settings of the MCS SDK data offline & sync API in an iOS application:
Having set these options, here's an example in iOS Swift app working with the data offline & sync client side functions to fetch the above policies:
It's no more complex than that. No raw REST API calls to MCS to extract the data, no creating timers or threads to periodically refresh expired data with MCS, no dealing with data update collisions and HTTP headers like If-Modified-Since, or when the device goes online and offline which data to use, this is all handled by the SDK, driven by the sync policy options you choose.
Overall writing data offline & sync capabilities as well as fast caching into your mobile apps can be a challenging exercise for day-to-day mobile developers to solve, but are a feature that mobile users are demanding more and more. As we've seen the requirement is massively simplified with Oracle Mobile Cloud Service, leaving your developers more time on building out other compelling features of your mobile app, and not wasting time reinventing the wheel when Oracle has a solution for you which it excels at: managing data.
Image courtesy of stockphotos at FreeDigitalPhotos.net