Ajay
Ajay

Reputation: 552

Sync the sqlite data of iphone application to server

I am trying to make the sync data application in which user have some value into the data base .And he have to send this data on to the server .With help http request how can i do that . I need the I am not using the php web server . I am using the Normal HTTP web page . ANd i have the some data in my iphone application and i want to Synchronization that data to server . I it must check the Internet is available or not .If the Internet is ON than only he will Synchronization the data .that's my question . Nothing else .You got my point or not . I thing people will reply me soon please Thanks

Upvotes: 4

Views: 2593

Answers (2)

macbirdie
macbirdie

Reputation: 16193

You have got to have some kind of server backend for synchronization of the local database. You can't do that using just the static HTML pages.

Your application and server have to have a way to talk to each other using a web service protocol, like SOAP or JSON/REST. Then your application has to translate the data from the database into such web service data objects.

Both your local database and the server (in case of more than one client) will have keep the records of at least the times of last synchronizations so both know what should be sent over the air in order to become in sync.

Also, in the usual case of more than one client, you have to solve the problem of conflicts resolution.

Web service versioning is important as well, as there will be very likely a need to improve the communication channel, maybe there will be changes in the database model to be synchronized.

As you can see, the idea of synchronizing local database to a server is not that simple, and if you think you can do it in a simple way, in time you'll realise that you're gradually reimplementing the aforementioned ideas.

Do a research on web service technologies, writing web services-aware apps, on synchronization with web services and on Reachability, for starters.

Upvotes: 2

Mundi
Mundi

Reputation: 80265

To check internet availability, check out the Reachability class from Apple. See this article.

To send data to a simple HTTP form via POST use NSURLConnection like in this article.

Cheers,
S

Upvotes: 0

Related Questions