Oracle Magazine, September/October 2017
Developer MOBILE ADDING SYNC EXPRESS There are three steps you must complete to utilize Sync Express in this app First add a script element to the HTML file to load the associated mcs sync js library that contains the Sync Express functionality This file must be the first script the app fetches and loads Typically in an Oracle JET app you would use RequireJS to load the other JavaScript libraries but the Sync Express library needs to work at a lower level than that so it can capture all remote HTTP calls Thats why you need to add it to the main index html page as the first script to run 13 Open the src index html file in your favorite text editor 14 Within the HTML head tag where annotated add the following script tag at the ORACLE MAGAZINE SEPTEMBER OCTOBER 2017 76 end of the head tag script type text javascript src js mcs sync js script The tag refers to the js mcs sync js library and for this article Ive taken a shortcut and provided the library for you in the src directory you copied over earlier from the downloaded zip file Typically this JavaScript library is downloaded from Oracle Mobile Cloud Service as part of the JavaScript or Cordova SDK Now add the Cordova Network Information plugin to give the sync library the ability to know if the app and device are online or not 15 In the same command window execute the following commands cd hybrid cordova plugin add cordova plugin network information
You must have JavaScript enabled to view digital editions.