Sharing a file between Mac and iOS

  • I have written a Mac app (with another, i.e. non-Cocoa, language), and now that I'm developing iOS apps in Xcode, I'd like to create an iOS app that can share its files. The file format is fairly straightforward SQLite, and I've determined that I can work with it just fine with the FMDB classes.

    But I am stumped as to how I might be able to more or less seamlessly handle syncing the file between the Mac and the iOS device. Unfortunately iCloud is not an option for me, and iTunes file sharing seems to be far from seamless.

    I'm hoping the collective brain trust on this list can point to me some possibilities I have not been exposed to that might serve my needs.
  • On Jul 19, 2012, at 8:22 AM, Dennis wrote:

    > I have written a Mac app (with another, i.e. non-Cocoa, language), and now that I'm developing iOS apps in Xcode, I'd like to create an iOS app that can share its files. The file format is fairly straightforward SQLite, and I've determined that I can work with it just fine with the FMDB classes.
    >
    > But I am stumped as to how I might be able to more or less seamlessly handle syncing the file between the Mac and the iOS device. Unfortunately iCloud is not an option for me, and iTunes file sharing seems to be far from seamless.
    >
    > I'm hoping the collective brain trust on this list can point to me some possibilities I have not been exposed to that might serve my needs.

    Networking and Bonjour?

    --
    Glenn L. Austin, Computer Wizard and Race Car Driver        <><
    "Where there's breath, there's hope!"
    <http://www.austin-soft.com>
  • On 2012 Jul 19, at 08:22, Dennis wrote:

    > Unfortunately iCloud is not an option for me

    Dropbox :))

    Seriously, Dropbox won't give you any crap.  Read this, though, and then research further to learn if the App Store rejection issue has been resolved…

    http://www.macrumors.com/2012/05/02/ios-apps-with-dropbox-integration-runni
    ng-afoul-of-apples-app-store-rules/
  • On Jul 19, 2012, at 12:52 PM, Jerry Krinock wrote:

    >
    > On 2012 Jul 19, at 08:22, Dennis wrote:
    >
    >> Unfortunately iCloud is not an option for me
    >
    > Dropbox :))
    >
    > Seriously, Dropbox won't give you any crap.  Read this, though, and then research further to learn if the App Store rejection issue has been resolved…
    >
    > http://www.macrumors.com/2012/05/02/ios-apps-with-dropbox-integration-runni
    ng-afoul-of-apples-app-store-rules/

    >

    Dropbox released a new SDK that solved the App Store rejection so that is no longer an issue.

    Dave
  • On Jul 19, 2012, at 9:52 AM, Jerry Krinock wrote:

    > Dropbox :))
    >
    > Seriously, Dropbox won't give you any crap.  Read this, though, and then research further to learn if the App Store rejection issue has been resolved…
    >
    > http://www.macrumors.com/2012/05/02/ios-apps-with-dropbox-integration-runni
    ng-afoul-of-apples-app-store-rules/


    Thanks. I hadn't thought of that.

    Since the Mac app isn't in the Mac store, that wouldn't be a problem, but I'd probably run into the same restriction trying to get the iOS app into the App Store. So I'd probably still need an alternative...
  • On Jul 19, 2012, at 8:22 AM, Dennis <lists...> wrote:

    > But I am stumped as to how I might be able to more or less seamlessly handle syncing the file between the Mac and the iOS device. Unfortunately iCloud is not an option for me, and iTunes file sharing seems to be far from seamless.

    If by 'syncing' you mean 'copying', there's always the document access UI in iTunes for copying files in and out of your iOS app's Documents directory, although it's kind of awkward to use.

    If you really mean 'syncing', then Dropbox is probably your best bet. Just be aware that its notion of syncing is pretty coarse-grained — it's going to update the entire file at once, and it won't resolve conflicts in the file. So if one database row gets changed on one device, and another one on another device, Dropbox is just going to go 'duh' and give you two copies of the file, one with each change. Also, of course, every time you make a change, the entire file will have to be uploaded (and downloaded on the other devices) so this doesn't scale well.

    —Jens
  • > I have written a Mac app (with another, i.e. non-Cocoa, language), and now that I'm developing iOS apps in Xcode, I'd like to create an iOS app that can share its files. The file format is fairly straightforward SQLite, and I've determined that I can work with it just fine with the FMDB classes.
    >
    > But I am stumped as to how I might be able to more or less seamlessly handle syncing the file between the Mac and the iOS device. Unfortunately iCloud is not an option for me, and iTunes file sharing seems to be far from seamless.
    >
    > I'm hoping the collective brain trust on this list can point to me some possibilities I have not been exposed to that might serve my needs.

    As others have said, Dropbox is a good solution although Dropbox is a file synchronization solution, not a data synchronization solution. I have been researching this myself. The Dropbox API is pretty easy to use and VoodooPad 5 uses it to sync Flying Meat: VoodooPad 5.0 Released. If you were to use Dropbox, I suggest using the API and integrating support rather than relying on Dropbox to correctly sync your data. I have run into many data corruption problems doing that.

    These all appear to work with CoreData so they might not help
    Simperium
    nothirst/TICoreDataSync · GitHub
    AFNetworking/AFIncrementalStore · GitHub

    Good luck
    Marc
  • > From: Jens Alfke <jens...>
    > Subject: Re: Sharing a file between Mac and iOS
    > To: "Dennis" <lists...>
    > Cc: <Cocoa-dev...>
    > Date: Thursday, 2012 July 19, 13:32
    >> On 2012 Jul 19, at 08:22, Dennis <lists...> wrote:
    >> But I am stumped as to how I might be able to
    >> more or less seamlessly handle syncing the file
    >> between the Mac and the iOS device. Unfortunately
    >> iCloud is not an option for me, and iTunes file
    >> sharing seems to be far from seamless.
    >
    > If by 'syncing' you mean 'copying'...
    > If you really mean 'syncing'

    Or do you mean contention management as you'd
    get with a massive data-base running on an NFS
    cluster, so that what is really multiple files
    on separate devices appears to be a monolithic
    data-base that's always "current"?
  • On Jul 19, 2012, at 3:12 PM, Jeffrey Oleander wrote:

    >> If by 'syncing' you mean 'copying'...
    >> If you really mean 'syncing'
    >
    > Or do you mean contention management as you'd
    > get with a massive data-base running on an NFS
    > cluster, so that what is really multiple files
    > on separate devices appears to be a monolithic
    > data-base that's always "current"?

    I mean synching one file such that when a user changes it on one device, it gets update on the other device.

    It looks like I need to explore using Dropbox.

    Thanks to everyone who contributed to this thread.
  • On Jul 19, 2012, at 5:16 PM, Dennis wrote:

    > It looks like I need to explore using Dropbox.

    iCloud? If these are your own application's files. Might be a possibility. Haven't tried it.
  • >
    > But I am stumped as to how I might be able to more or less seamlessly
    > handle syncing the file between the Mac and the iOS device.

    This is perhaps the most glaring and insufferable omission in the SDK.  I
    urge you to file a bug report on this and tell Apple that you want to be
    able to sync data between your iOS app and a companion app on the Mac, *
    without* Internet access or hokey wireless workarounds.

    Developers could do this routinely in the '90s under Palm OS; and yet years
    into the iPhone SDK, Apple still hasn't figured it out?  This should have
    been expected and resolved within the first couple of SDK updates, if not
    at launch.  Now I'm sure the myth of free, high-speed, worldwide,
    unlimited, and always-available Internet access will be used as an excuse
    to continue blowing it off.
  • On Thu, Jul 19, 2012, at 03:58 PM, Gavin Stokes wrote:
    >>
    >> But I am stumped as to how I might be able to more or less seamlessly
    >> handle syncing the file between the Mac and the iOS device.
    >
    >
    > This is perhaps the most glaring and insufferable omission in the SDK.  I
    > urge you to file a bug report on this and tell Apple that you want to be
    > able to sync data between your iOS app and a companion app on the Mac, *
    > without* Internet access or hokey wireless workarounds.
    >
    > Developers could do this routinely in the '90s under Palm OS; and yet
    > years
    > into the iPhone SDK, Apple still hasn't figured it out?  This should have
    > been expected and resolved within the first couple of SDK updates, if not
    > at launch.  Now I'm sure the myth of free, high-speed, worldwide,
    > unlimited, and always-available Internet access will be used as an excuse
    > to continue blowing it off.

    Really, Palm figured it out? Before I ditched my Centro, HotSync would
    constantly replace the existing device database.

    --Kyle Sluder
  • > iCloud? If these are your own application's files. Might be a possibility. Haven't tried it.

    According to Apple, apps have to be on the Mac App Store in order to
    use iCloud APIs.
    That makes it an automatic 2nd choice (over something like Dropbox)
    for any dev that isn't going to be MAS-only.

    On Thu, Jul 19, 2012 at 3:34 PM, Michael Hall <mik3hall...> wrote:
    >
    > On Jul 19, 2012, at 5:16 PM, Dennis wrote:
    >
    >> It looks like I need to explore using Dropbox.
    >
    > iCloud? If these are your own application's files. Might be a possibility. Haven't tried it.

    --
    Mark Munz
    unmarked software
    http://www.unmarked.com/
  • On Jul 19, 2012, at 6:40 PM, Mark Munz wrote:

    >> iCloud? If these are your own application's files. Might be a possibility. Haven't tried it.
    >
    > According to Apple, apps have to be on the Mac App Store in order to
    > use iCloud APIs.
    > That makes it an automatic 2nd choice (over something like Dropbox)
    > for any dev that isn't going to be MAS-only.

    True it does seem tightly coupled with the new application direction.
    Thats why Dropbox is on my machine.
    I'm a little surprised iCloud doesn't find a little more advocation on this list though.
  • You've found both the methods which apple makes available. If you don't want to use iCloud, or can't because it ties you to the MAS, then you're left with iTunes file sharing. It's not a lovely solution, it's ok for moving a file every once in a while or priming some data one-time, but more than that it won't really do. It doesn't help that it's so rarely used (in my experience) that many users don't even know it's there .. how often do you click on the App tab when your device is connected and you have iTunes up and scroll to the bottom of the page to see the 'file sharing' stanza?

    That is however the cheapest solution, where cheapest means you can implement it with very little effort indeed and it does work.

    On Jul 19, 2012, at 11:22 PM, Dennis wrote:

    > I have written a Mac app (with another, i.e. non-Cocoa, language), and now that I'm developing iOS apps in Xcode, I'd like to create an iOS app that can share its files. The file format is fairly straightforward SQLite, and I've determined that I can work with it just fine with the FMDB classes.
    >
    > But I am stumped as to how I might be able to more or less seamlessly handle syncing the file between the Mac and the iOS device. Unfortunately iCloud is not an option for me, and iTunes file sharing seems to be far from seamless.
    >
    > I'm hoping the collective brain trust on this list can point to me some possibilities I have not been exposed to that might serve my needs.
  • On 2012 Jul 19, at 11:32, Jens Alfke wrote:

    > every time you make a change, the entire file will have to be uploaded [by Dropbox] (and downloaded on the other devices) so this doesn't scale well.

    I tested this about a year ago and found otherwise.  Drag a large file into your Dropbox.  Say that it takes 5 minutes to transfer to your other device.  Do the bits/second math with your internet connection speed and verify that the transmission time is about as expected.  Now change a few bits in the file.  Voila!  The other device is updated within seconds.  Dropbox apparently transmits only changed blocks.  Very nice.

    What's even better, is that I found it also works that way with a Core Data sqlite store.  Changing one record in a large store does not transmit the whole store.

    > it won't resolve conflicts in the file. So if one database row gets changed on one device, and another one on another device, Dropbox is just going to go 'duh' and give you two copies of the file, one with each change.

    That is correct.  Dropbox "syncing" works good for "multi-device" situations, not "multi-user".  But that is good enough for most consumer applications.
  • On Thu, 19 Jul 2012 15:58:34 -0700, Gavin Stokes said:

    > Developers could do this routinely in the '90s under Palm OS; and yet years
    > into the iPhone SDK, Apple still hasn't figured it out?  This should have
    > been expected and resolved within the first couple of SDK updates, if not
    > at launch.

    I'm pretty sure they don't want to.

    > Now I'm sure the myth of free, high-speed, worldwide,
    > unlimited, and always-available Internet access will be used as an excuse
    > to continue blowing it off.

    That, and Apple is renowned for hating wires.

    Alas, the model these days is to use the "cloud" so that they can data-mine your data and target advertising. :(

    --
    Sean
previous month july 2012 next month
MTWTFSS
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Go to today