More Mobile Software

Synchronization

Import, Export and Synchronization via Cloud Services

Import, Export and Synchronization via Cloud Services (including iCloud Drive) in Dive Log on iOS.
(Some detailed background and analysis)


The most resent version of Dive Log for iOS (2.3, release July 2017) adds support for Importing, Exporting and Synchronizing logbook data via Cloud services such as iCloud Drive, Dropbox, GoogleDrive, OneDrive and Box. This new support depends on an iOS feature called “File Provider Extensions” and may require a bit more explanation to fully take advantage of the capabilities. It is also important to understand that this support is different from the “iCloud Synchronization” that has been available in Dive Log on iOS for a number of years.

The existing “iCloud Synchronization” has been relabeled “iOS iCloud Synchronization”. This is exactly the same as what you may have been using for some time now and has no other changes. This feature can use iCloud Drive OR the older iCloud Documents & Data service depending on how your Apple ID is configured. However, when iCloud Drive is used as the underlying file mechanism you will not be able to see these files except from within Dive Log on iOS devices signed in with your Apple ID. These files are stored in a private area of iCloud Drive (or Documents & Data if you are still using that service) and due to Apple’s security mechanisms can not be exposed in any other way.

The new features added in the 2.3 release of Dive Log allows you to expose your logbook data via iCloud Drive (or other File Provider Extensions installed on your device) so that you can exchange those files with other devices and potentially other users.

By default, most iOS devices are configured to support iCloud Drive (it is possible to turn this off so if you do not have iCloud Drive available you should look in your device’s settings under iCloud to enable it). If you want to use any of the other Cloud services that have File Provider Extension support, all you need to do is install the app from that service (Dropbox, GoogleDrive, Box, OneDrive, etc.) on your device. If the service implements the File Provider Extension, then it will (or should be) available from within Dive Log. Note that all File Provider Extension implementations are not created equally and do not necessarily support all the possible modes that Dive Log can take advantage of. Further, some of the implementations have significant bugs that can cause them to not work properly. However, the advantage to using the File Provider Extension support from within Dive Log is that as these 3rd party implementations increase and improve, Dive Log will automatically be able to take advantage of the improvements without us issuing a new version of Dive Log.

Not surprisingly, the best implementation of the File Provider Extension is iCloud Drive itself. So for the best experience, it is suggested that you use iCloud Drive to store and interact with your logbook files. That said, the other services do work as well and I’ll detail the limitations later in this post.

In general, this new support includes the ability to:

  • Export complete Dive Log format logbooks and DAN DL7 format files,
  • Import a Dive Log formatted logbook (either replacing the active logbook or possibly merging chnages into the active logbook if the remote Dive Log formatted logbook shares an ancestry with the active logbook) and Import dives from a DAN DL7 formatted file into the active logbook,
  • Synchronize the active logbook with the selected remote Dive Log formatted logbook file (provided that it shares a common ancestry)

via installed “File Provider Extensions”. This will enable you to interact with the Cloud Synchronization features in DiveLogDT or Dive Log Manager on the Mac as well as with Diving Log 6.0 on a Windows PC via the supported Cloud services as well as exchange files between iOS devices. One thing to keep in mind though is that synchronizing data via this mechanism (vs using the WiFi Synchronization support) does require internet access and will not work until both devices can interact with the internet.

In order to synchronize between Dive Log on iOS and Dive Log on other iOS devices or applications on Macs or PCs you generally need to follow these steps:

  1. Upload an initial copy of the logbook to the Cloud service (in Dive Log this is accomplished via the new “Export” feature. You would typically start with the device that has your most complete logbook as you will be using this as the basis for all future logbooks.
  2. Load that initial logbook from the Cloud service onto the other devices that want to participate in Synchronization (in Dive Log this would be accomplished via the new “Import” feature.
  3. As you make changes on any device, Synchronize those changes with the copy of the logbook in the Cloud service, and then synchronize each device in turn with that logbook in the Cloud service (in Dive Log this is accomplished using the “Synchronize Dive Log Logbook” feature).

When you Synchronize logbooks via this mechanism, Dive Log will work with the File Provider Extension to resolve any conflicts *IF* the File Provider Extension supports conflict resolution (as of right now, iCloud Drive is the only service that exposes conflict files to Dive Log to be resolved). Conflicts can arise when data is sent to the server from multiple devices or if the internet was not available at the time a file was submitted. Other services use other mechanisms local to their servers to resolve conflict … this usually means that they “pick the winner” based on some timestamp mechanism and Dive Log only ever sees this “winner” so no record by record conflict resolution is possible). Also, not all services implement the features required to support this bi-directional synchronization.

The File Provider Extension provides for two types of services: “Copy” and “Open”. In the case of “Copy”, the requesting app (Dive Log in this case) is provided a “Copy” of the Cloud file to work with but can not write the remote version of the file. Dropbox, for example, only supports the “Copy” service so it is not possible to do the bi-directional synchronization with Dropbox using a single file (note you can “Import with Sync” and then “Export” the resulting logbook file back to Dropbox to get a similar effect but it will not be able to replace the existing file in Dropbox unless you delete it first). In the case of “Open”, Dive Log is given access to a writable copy of the remote file so that it can upload any changes that it makes via the Synchronization process. This service is supported by iCloud Drive, Box, OneDrive and GoogleDrive *BUT*, as things currently stand, only iCloud Drive and Box implement this service without bugs (this can change with each update to the File Provider Extension apps so you may find that other services start working properly in the future).

In summary, as things stand as of this writing:

  • iCloud Drive supports “Copy” and “Open” semantics. Conflict resolution is supported.
  • Box supports “Copy” and “Open” semantics. Conflict resolution is done before Dive Log gets access to the file so no conflict resolution is done by Dive Log.
  • OneDrive supports “Copy” and “Open” semantics. No conflict resolution is available to Dive Log and bugs may prevent the remote file from being updated.
  • Google Drive supports “Copy” semantics and reports that it supports “Open” semantics, but bugs in their implementation prevent synchronization from working properly (Import works with some limitations and Export seems to work).
  • Dropbox only support “Copy” semantics so Import and Export both are available but not Synchronization.

Hopefully this provides some background to help you take advantage of the new facilities. You can (and should) make backups of your logbooks before doing any synchronization operations. Dive Log will maintain the most recent logbook that was in place before an operation locally so that you can revert to it if needed. You can also use the “Export” feature to make a backup of any Dive Log logbook and you can use the Cloud service provider (i.e. File Provider Extension) apps to make backups of your files in their respective services.