Oracle Magazine, September/October 2017
Developer MOBILE refresh the data when the app is online and offline you will need a way to see when fresh data is coming down from the server To present this fresh data Ive hacked the Oracle Mobile Cloud Service remote API that I provided and mapped the phone numbers to the current time in milliseconds and incremented each number by the record ID value As such each time you refresh the list view the server updates all the phone numbers of all the employees and this proves the data is getting updated via the server at each refresh in turn proving your mobile device is currently online Now lets watch what happens when you switch from online to airplane mode and the app can no longer access the remote API provided by Oracle Mobile Cloud Service 10 In the Android Emulator turn on airplane mode Do this by swiping down the menu bar of the Android Emulator and selecting the airplane icon Then swipe the menu back up and return to the app 11 Pull to refresh the list view again and note that now when the app attempts to refresh the list view unsurprisingly the app can no longer fetch fresh data Depending on the operating system version this attempt might eventually time out and crash or continue indefinitely Obviously this isnt what you want You want the application to continue to run during offline use and preferably default back to showing the previously fetched data rather than getting stuck This is where Sync Express comes in It will provide these offline capabilities with minimal effort 12 Before you proceed switch the Android Emulator airplane mode off terminate the Android Emulator and in the command window press the Ctrl and C keys simultaneously to kill the running process ORACLE MAGAZINE SEPTEMBER OCTOBER 2017 75
You must have JavaScript enabled to view digital editions.