Online file sharing with iOS 8: upgrading the Green Lab Notebook app

picker_gln02Mobile apps for iOS have always been able to share files by a variety of different mechanisms, but many of these were limited in ways that were very detrimental to the user experience. The Green Lab Notebook app is now catching up to the new technology introduced with iOS 8: using the “document picker” interface to import and export files to document providers, which immediately makes it fully interoperable with iCloud, and file sharing services like Dropbox.

All of the apps from Molecular Materials Informatics have placed an extremely high priority on data sharing, since this is a pivotal component of the value proposition for non-trivial mobile apps. As tools designed for content creation and increasingly advanced calculation, modelling and visualisation tasks, most of the useful things that these apps can do are only as good as their ability to bring data in and/or pass it along to another tool or data repository.

If you are reading this blog post not too long after it was written (January 2015), you can check out a summary page that was written some time ago, describing some of the fundamental ways of sharing data. The page is going to be rewritten soon, but for the moment it serves as a museum piece. Email has been a staple from the beginning, and the ability for iOS apps to register themselves as handlers for certain file types (i.e. chemical datafiles in this case) allows content to be downloaded “into the app” from a variety of sources, including incoming email attachments and web pages. It is also possible to use this method to pass data between two apps, although it is quite a blunt instrument, and combined with the fact that each app is heavily quarantined in its own sandbox, this makes for a mediocre user experience: an app can “open” a file, and the operating system can offer a list of other apps that can be “launched” in order to receive it. It works, but there are so many ways in which it could be better.

Some years ago, the value of services like the ultra successful Dropbox became readily apparent, and a whole new app was created in order to take advantage of it: MolSync. This specialised app provides (or soon to be past tense: provided) a file browser interface to Dropbox, in order to intermediate between chemical data awareness and the apps that can benefit from it.

When iOS 8 was announced in mid-2014, it brought with it some very exciting new developments, some of which seemed to be directly relevant to this niche field of scientific mobile apps. The reality turned out to be a bit hit and miss (e.g. the Swift programming language, which still needs to go back in the oven for awhile).

The other dubious new feature was iCloud Drive. Based on the press releases and documentation, it seemed very certain that this would be a capability that provided all of the things that Dropbox does, i.e. syncing files between every device with utmost convenience, except maybe without as many features for sharing with other users. The thing that makes it interesting is that it comes from Apple, which means that everyone in the ecosystem has it installed by default, and its APIs are baked into all modern versions of their operating systems. This kind of integration is a really big deal.

Unfortunately, early experiments with this new product were rather unsatisfactory. There are a lot of gotchas that are not in the documentation, which leaves the programmer wondering as to whether things are not working due to design, bugs in the service, or bugs in the app that is trying to make use of them. The version of the Green Lab Notebook app that is current in the AppStore at the time of writing does have the ability to sync documents between devices using iCloud Drive, which means that two devices can point to some number of shared experiment documents and have them automatically updated. But the triggers that make file synching work are a bit of a mystery: I’m not sure anyone outside of Apple actually knows why it sometimes seems like nothing is happening. And perhaps the biggest disappointment is that files that are uploaded to a shared repository from a mobile device’s officially declared file container do not seem to be accessible from an actual Mac computer. As far as I can tell this is contrary to the documentation, and it was one of the killer features that I was most excited about. No doubt an answer will come to light sooner or later – I’m thinking of it as a growing pain – but for now I’m still in the dark.

The new feature that does deliver the goods is the so-called document picker mechanism. Used in the most simple way, this allows the app to do two things: (1) export a file by asking the user to select a file hosting service and then browse the location in which to place it; and (2) import a file from a selected service, by browsing around within its content list. This is incredibly important because the previous ways for passing files from one sandbox to another were so crude. But now, another available app can provide an inline user interface within the current one, allowing the user to select things like location and content, so it is not only more focused, but allows both push and pull styles, rather than just a generic launch.

As a baseline, all devices provide iCloud Drive as one of the file sharing services, so as long as it is switched on, everyone has access to one compatible service. Unlike using iCloud Drive with app-specific containers, uploading and downloading files to the general iCloud area does eventually sync with a Mac, albeit not necessarily as quickly as one would like.

It gets much more interesting, though, if you have the Dropbox app installed on your device (if you don’t have it yet, you definitely need to go get it from the AppStore). Because this app also conforms to the same extension protocols, it means that apps that ask for generic file import/export can browse the dropbox folders inline.

In the forthcoming update for the Green Lab Notebook app, importing a file from Dropbox looks something like this:

picker_import

The new import icon, when pressed, asks the system to present a list of potential providers, which on my devices currently includes iCloud and Dropbox (but for all I know you may have a whole suite of other providers installed on yours). The inline browsing dialog allows navigation through folders and selecting individual files, in this case a datasheet with some experiments that were curated from my Ph.D. thesis. The final import dialog asks where to place the newly acquired content, within the hierarchy that the Green Lab Notebook uses to present its various flavours of chemical data.

Exporting content is very similar, except that the steps are carried out in reverse:

picker_export

The icon of interest is the same one that was previously used to launch data in other apps. It still performs this role, but the first icon, right at the top, shows the Export icon with the label “File sharing”. After making sure the selected file format is the desired one, pressing the export button goes through the two step process of selecting a service, then giving the service the opportunity to let you decide whereabouts to place the file, which allows navigation of the directory hierarchy. The above example shows uploading to Dropbox: the final button, “Save to …”, causes the file to be uploaded. From that point onward, any of your devices or computers that have the Dropbox syncing software, or any web client, will be able to view and download the file.

Thus far, only the Green Lab Notebook has been upgraded to use the document picker interface for sharing files. The rest of the menagerie will be updated sequentially. And when they are all done, it will be time to say goodbye to the MolSync app, because its functionality is no longer needed.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s