4

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

Ajay
  • 552
  • 1
  • 5
  • 18

2 Answers2

2

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.

Community
  • 1
  • 1
macbirdie
  • 16,086
  • 6
  • 47
  • 54
  • i am getting data from sqlite which is very large how can i sync that .I am getting data by firing the this statement select * from employee .How can i send this data to server which i am getting only from sqlite . – Ajay Aug 24 '11 at 10:52
  • See, we're all here glad to help, but you're essentially asking to solve this problem for you. I gave you pointers already. If you want me to clear them up, that's fine, but don't expect a complete solution here. That's not how it works. – macbirdie Aug 24 '11 at 12:25
  • I think you not get my point .I am asking IS THAT I CAN send complete DATA TO SERVER FOR SYNC WHICH I AM GETTING FROM SQLITE BY FIRING THE SELECT STATEMENT. IS THAT I AM . – Ajay Aug 25 '11 at 03:55
  • Yes, you can. As I said already, "Then your application has to translate the data from the database into such web service data objects." – macbirdie Aug 25 '11 at 06:30
  • http://stackoverflow.com/questions/7185016/sqlite-data-sync-to-server-from-iphone please check it out this i have same problem friend – Ajay Aug 25 '11 at 07:26
0

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

Community
  • 1
  • 1
Mundi
  • 79,884
  • 17
  • 117
  • 140
  • But how can I check is that net is available or not .And sync the data. – Ajay Aug 24 '11 at 09:26
  • See my answer. You check with Reachability. You sync with the POST form. I answered both your questions, please press accept. – Mundi Aug 24 '11 at 12:35
  • IS THAT I CAN send directly sqlite DATA TO SERVER FOR SYNC WHICH I AM GETTING FROM SQLITE BY FIRING THE SELECT STATEMENT. IS THAT I AM right – Ajay Aug 25 '11 at 06:05
  • Sure, you are right, even if what you say is not entirely clear. – Mundi Aug 25 '11 at 06:17
  • http://stackoverflow.com/questions/7185016/sqlite-data-sync-to-server-from-iphone check it out this i need the same thing – Ajay Aug 25 '11 at 08:28
  • This question is very similar to yours in that it is also entirely unintelligible. – Mundi Aug 25 '11 at 12:13
  • than how can i do this is that you have any idea – Ajay Aug 26 '11 at 03:26