Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Data file transfer to desktop

Hi guys I have a client that wants a custom app that reports information to local file or db but then when back at the office wants to download this info to a pc.

Is the only way to get stored local data off an iPhone or iPad to email it off the device? Little lost as getting data off devices.

Any advice would be great.

— asked June 16th 2010 by James Becker
  • data
  • desktop
  • ipad
  • iphone
  • transfer
1 Comment
  • To elaborate a little more on my comment below. To get data off the device and onto a cloud, you could add a column to all your tables named cloud_save or something, when you alter or insert that column should bet set as true or 1. When you find a internet connection or want to sync the databases you can run a function which will loop through your local sqlite database and insert the row's (only if cloud_save column is set to true) in json format. Once this loop has been performed, you could then use the appcelerator network api to upload it to your webserver which will then process it.

    Hopefully this idea will help you guys.

    — commented June 19th 2010 by Bryce Wilkinson

5 Answers

  • @Ken Bantoft
    Using email is probably a bad idea for trying to sync data. It's slow, unreliable and a pain to program. I would suggest you build your app in titanium with a sqlite database where you can edit everything locally. When the user changes something in the database, a property which contains a timestamp is updated with the current timestamp. When the user finds a internet connection your app should compare timestamps with a timestamp on the server, if they match, nothing is uploaded or downloaded to the device. If they don't match and the client did make a change, you should then sync the databases through http.

    I suggest you use php+mysql on the server end, it's extremely easy to use the http protocol and I've used it in multiple applications.

    — answered June 19th 2010 by Bryce Wilkinson
    permalink
    1 Comment
    • @Bryce Wilkinson - Yes, email is too limiting, hence why I chose to do the upload to webserver option. In my case, I'm dealing with 1-4MB files to shuffle around between Product, iPad and Internet server, so this worked really well. The fact that HTTP Basic Auth is supported meant I could keep things reasonable secure as well.

      — commented July 3rd 2010 by Ken Bantoft
  • I would also like to know this. We are doing a one-off app, and would like to retrieve statistical data after the promotion is over.

    — answered June 17th 2010 by scott l
    permalink
    0 Comments
  • I had a similar requirement - I needed to rip data from a device in the field (well, several) and then allow tech's to 'upload' the data when they get back online somewhere useful.

    Your simple options for getting data off are pretty much:

    1. Email, as you said
    2. Upload to a WebServer

    I opt'd for 2, and with 15 lines of PHP code somewhere you can Upload the files/data from the App onto the server, and then you have access to the data. In my case, the PHP code loads it into a MySQL database, but you could do anything you wanted at that point.

    Cooler option:
    1) Use Dropbox or AirSharing or (iDevice Filesharing/Synctool of your choice)'s APIs to allow you to move the data into one of those apps, and let it do the syncing to your PC/Mac

    — answered June 18th 2010 by Ken Bantoft
    permalink
    0 Comments
  • As the iPad becomes more widespread and used in businesses more for utilities I think this functionality needs to be addressesed, could a extension be created to link to an appcellerator Desktop app?

    — answered June 19th 2010 by James Becker
    permalink
    0 Comments
  • As the iPad becomes more widespread and used in businesses more for utilities I think this functionality needs to be addressesed, could a extension be created to link to an appcellerator Desktop app?

    — answered June 19th 2010 by James Becker
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.