Sync sqlite with idevices

Discussion in 'iOS Programming' started by macobss89, Sep 19, 2011.

  1. macobss89 macrumors newbie

    Joined:
    Jun 5, 2011
    #1
    Hi
    I'm doing an app with core data and sqlite. I need to sync the database between two iphones or more running the same app, how can i achieve that?
    Can anyone help?

    Thanks in advance!
     
  2. troop231 macrumors 603

    Joined:
    Jan 20, 2010
    #2
    You may need a backend "server" to accomplish this.
     
  3. macobss89 thread starter macrumors newbie

    Joined:
    Jun 5, 2011
  4. idelovski macrumors regular

    Joined:
    Sep 11, 2008
    #4
    Bonjour is a service discovery protocol. It is useed to find the other side, not to transfer data. For that, you'll need bsd sockets/CFSocket or NSStream or GameKit.

    On the SQLite level, you'll probably have datestamps in each record. Time for creation and time of last modification if modifications are possible. Then you check the time of last sync and then send everything that's newer. Other side imports only things that do not exist or those with newer timestamps.
     
  5. macobss89 thread starter macrumors newbie

    Joined:
    Jun 5, 2011
    #5
    your information gave me a head start, but can you refer me to resources to read? or some sample code ?
     
  6. idelovski macrumors regular

    Joined:
    Sep 11, 2008
    #6
    Well, you can start with this: Online Session Code for Big Objects (Plus a Warning), blog post by Jeff LaMarche. Here he fixes something from his book, More iPhone Development. Link to the code is right there in the article.

    Then if you like it, you can buy the whole book and download its code and play with it.
     
  7. RAG-NAVEED macrumors newbie

    Joined:
    Sep 12, 2012
    #7
    I have created app in adobe flex builder where data comes from SQLite database.
    My question is when i m goin to submit application in app store, what should i do to sublit database along with it??
     

Share This Page