iPhone : How to sync data with the web-service when internet is reachable?
up vote
0
down vote
favorite
I know how to check internet connection. Tell me how to sync app data.
How does the synchronization works when internet is available ?
My confusion :
I have app which uses the web-service to display data on iPhone and also on site. Now I can update user's work when the net is available by calling web-service at same time when user does some task.
But when internet is not available, I have to keep user's data locally(say SQLite) in iPhone and when the internet is reachable I have to update all the data on server.
For Example,
If internet is reachable, user works on some task and I update the data on server at the dame time.
But Now internet is not reachable, user works on `N task`. I can not update on server, I have to wait for internet
How can I update all task on web-server at time?
So my question is :
How can I update all the data when net is available ?
Any link or code which can help me ?
iphone objective-c ios cocoa-touch
add a comment |
up vote
0
down vote
favorite
I know how to check internet connection. Tell me how to sync app data.
How does the synchronization works when internet is available ?
My confusion :
I have app which uses the web-service to display data on iPhone and also on site. Now I can update user's work when the net is available by calling web-service at same time when user does some task.
But when internet is not available, I have to keep user's data locally(say SQLite) in iPhone and when the internet is reachable I have to update all the data on server.
For Example,
If internet is reachable, user works on some task and I update the data on server at the dame time.
But Now internet is not reachable, user works on `N task`. I can not update on server, I have to wait for internet
How can I update all task on web-server at time?
So my question is :
How can I update all the data when net is available ?
Any link or code which can help me ?
iphone objective-c ios cocoa-touch
do you use Reachability class?
– user784625
Feb 2 '12 at 14:13
so what you actually want is a SQLlite crash course?!?
– AnthonyBlake
Feb 2 '12 at 14:59
@AnthonyBlake: I want basic knowledge of Sync process.
– Devang
Feb 2 '12 at 16:24
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I know how to check internet connection. Tell me how to sync app data.
How does the synchronization works when internet is available ?
My confusion :
I have app which uses the web-service to display data on iPhone and also on site. Now I can update user's work when the net is available by calling web-service at same time when user does some task.
But when internet is not available, I have to keep user's data locally(say SQLite) in iPhone and when the internet is reachable I have to update all the data on server.
For Example,
If internet is reachable, user works on some task and I update the data on server at the dame time.
But Now internet is not reachable, user works on `N task`. I can not update on server, I have to wait for internet
How can I update all task on web-server at time?
So my question is :
How can I update all the data when net is available ?
Any link or code which can help me ?
iphone objective-c ios cocoa-touch
I know how to check internet connection. Tell me how to sync app data.
How does the synchronization works when internet is available ?
My confusion :
I have app which uses the web-service to display data on iPhone and also on site. Now I can update user's work when the net is available by calling web-service at same time when user does some task.
But when internet is not available, I have to keep user's data locally(say SQLite) in iPhone and when the internet is reachable I have to update all the data on server.
For Example,
If internet is reachable, user works on some task and I update the data on server at the dame time.
But Now internet is not reachable, user works on `N task`. I can not update on server, I have to wait for internet
How can I update all task on web-server at time?
So my question is :
How can I update all the data when net is available ?
Any link or code which can help me ?
iphone objective-c ios cocoa-touch
iphone objective-c ios cocoa-touch
edited Feb 2 '12 at 14:23
asked Feb 2 '12 at 14:08
Devang
6,869135493
6,869135493
do you use Reachability class?
– user784625
Feb 2 '12 at 14:13
so what you actually want is a SQLlite crash course?!?
– AnthonyBlake
Feb 2 '12 at 14:59
@AnthonyBlake: I want basic knowledge of Sync process.
– Devang
Feb 2 '12 at 16:24
add a comment |
do you use Reachability class?
– user784625
Feb 2 '12 at 14:13
so what you actually want is a SQLlite crash course?!?
– AnthonyBlake
Feb 2 '12 at 14:59
@AnthonyBlake: I want basic knowledge of Sync process.
– Devang
Feb 2 '12 at 16:24
do you use Reachability class?
– user784625
Feb 2 '12 at 14:13
do you use Reachability class?
– user784625
Feb 2 '12 at 14:13
so what you actually want is a SQLlite crash course?!?
– AnthonyBlake
Feb 2 '12 at 14:59
so what you actually want is a SQLlite crash course?!?
– AnthonyBlake
Feb 2 '12 at 14:59
@AnthonyBlake: I want basic knowledge of Sync process.
– Devang
Feb 2 '12 at 16:24
@AnthonyBlake: I want basic knowledge of Sync process.
– Devang
Feb 2 '12 at 16:24
add a comment |
3 Answers
3
active
oldest
votes
up vote
3
down vote
accepted
Try to put a Field as isOfflinerecord
in your database (In case If you are using Database) and when connectivity comes back update or Insert only those data.
This could be your initial step.
add a comment |
up vote
1
down vote
This question might be able to help you. using the Reachability class from Apple.
` How to check for an active Internet connection on iOS or OSX?
I know how to check internet connection. Tell me something about syncing data
– Devang
Feb 2 '12 at 14:24
Well, the way to do that would be to make a request to the server every so often when there is internet, and download the latest updates, and save them locally. Depending on the size of your online database you could just download it all at once.
– Amit Shah
Feb 2 '12 at 14:27
oh !! and how to upload app data on server ?
– Devang
Feb 2 '12 at 14:28
Depending on how your server is set up, you would just send aPOST
request containing the data. Using NSURLConnection is the simplest HTTP library to use, but there are others.
– Amit Shah
Feb 2 '12 at 14:30
@Devang so you want a SQLLite crash course AND a webservices crash course?
– AnthonyBlake
Feb 2 '12 at 15:01
add a comment |
up vote
1
down vote
use reachability class and then you can set a notifier that will notify when there will be a change of the network status
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(checkNetworkStatus:) name:kReachabilityChangedNotification object:nil];
hostReachable = [[Reachability reachabilityWithHostName: @"www.google.com"] retain];
[hostReachable startNotifier];
- (void) checkNetworkStatus:(NSNotification *)notice
// called after network status changes
NetworkStatus hostStatus = [hostReachable currentReachabilityStatus];
switch (hostStatus)
case NotReachable:
break;
case ReachableViaWiFi:
break;
case ReachableViaWWAN:
break;
I know how to check internet connection. Tell me something about syncing data.
– Devang
Feb 2 '12 at 14:24
run the web service you have multiple times?
– user784625
Feb 2 '12 at 14:38
1
@Devang How you sync the data will depend on your server and what you are transmitting. It is entirely up to you how you do this and if you ask 10 developers, you will probably get 10 different solutions. I suggest you go and think about it and come up with your own solution as this is quite a broad question to ask.
– Nick Bull
Feb 2 '12 at 15:41
@NickBull : I dont have any basic knowledge. I am just asking for basic knowledge.
– Devang
Feb 2 '12 at 16:19
@Devang Seriously, if you don't have any idea where to start with this, then I think you need to start learning some more basics of programming
– Nick Bull
Feb 2 '12 at 21:40
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
Try to put a Field as isOfflinerecord
in your database (In case If you are using Database) and when connectivity comes back update or Insert only those data.
This could be your initial step.
add a comment |
up vote
3
down vote
accepted
Try to put a Field as isOfflinerecord
in your database (In case If you are using Database) and when connectivity comes back update or Insert only those data.
This could be your initial step.
add a comment |
up vote
3
down vote
accepted
up vote
3
down vote
accepted
Try to put a Field as isOfflinerecord
in your database (In case If you are using Database) and when connectivity comes back update or Insert only those data.
This could be your initial step.
Try to put a Field as isOfflinerecord
in your database (In case If you are using Database) and when connectivity comes back update or Insert only those data.
This could be your initial step.
answered Feb 17 '12 at 13:40
Heena
1,51012752
1,51012752
add a comment |
add a comment |
up vote
1
down vote
This question might be able to help you. using the Reachability class from Apple.
` How to check for an active Internet connection on iOS or OSX?
I know how to check internet connection. Tell me something about syncing data
– Devang
Feb 2 '12 at 14:24
Well, the way to do that would be to make a request to the server every so often when there is internet, and download the latest updates, and save them locally. Depending on the size of your online database you could just download it all at once.
– Amit Shah
Feb 2 '12 at 14:27
oh !! and how to upload app data on server ?
– Devang
Feb 2 '12 at 14:28
Depending on how your server is set up, you would just send aPOST
request containing the data. Using NSURLConnection is the simplest HTTP library to use, but there are others.
– Amit Shah
Feb 2 '12 at 14:30
@Devang so you want a SQLLite crash course AND a webservices crash course?
– AnthonyBlake
Feb 2 '12 at 15:01
add a comment |
up vote
1
down vote
This question might be able to help you. using the Reachability class from Apple.
` How to check for an active Internet connection on iOS or OSX?
I know how to check internet connection. Tell me something about syncing data
– Devang
Feb 2 '12 at 14:24
Well, the way to do that would be to make a request to the server every so often when there is internet, and download the latest updates, and save them locally. Depending on the size of your online database you could just download it all at once.
– Amit Shah
Feb 2 '12 at 14:27
oh !! and how to upload app data on server ?
– Devang
Feb 2 '12 at 14:28
Depending on how your server is set up, you would just send aPOST
request containing the data. Using NSURLConnection is the simplest HTTP library to use, but there are others.
– Amit Shah
Feb 2 '12 at 14:30
@Devang so you want a SQLLite crash course AND a webservices crash course?
– AnthonyBlake
Feb 2 '12 at 15:01
add a comment |
up vote
1
down vote
up vote
1
down vote
This question might be able to help you. using the Reachability class from Apple.
` How to check for an active Internet connection on iOS or OSX?
This question might be able to help you. using the Reachability class from Apple.
` How to check for an active Internet connection on iOS or OSX?
edited May 23 '17 at 12:11
Community♦
11
11
answered Feb 2 '12 at 14:20
Amit Shah
3,89221726
3,89221726
I know how to check internet connection. Tell me something about syncing data
– Devang
Feb 2 '12 at 14:24
Well, the way to do that would be to make a request to the server every so often when there is internet, and download the latest updates, and save them locally. Depending on the size of your online database you could just download it all at once.
– Amit Shah
Feb 2 '12 at 14:27
oh !! and how to upload app data on server ?
– Devang
Feb 2 '12 at 14:28
Depending on how your server is set up, you would just send aPOST
request containing the data. Using NSURLConnection is the simplest HTTP library to use, but there are others.
– Amit Shah
Feb 2 '12 at 14:30
@Devang so you want a SQLLite crash course AND a webservices crash course?
– AnthonyBlake
Feb 2 '12 at 15:01
add a comment |
I know how to check internet connection. Tell me something about syncing data
– Devang
Feb 2 '12 at 14:24
Well, the way to do that would be to make a request to the server every so often when there is internet, and download the latest updates, and save them locally. Depending on the size of your online database you could just download it all at once.
– Amit Shah
Feb 2 '12 at 14:27
oh !! and how to upload app data on server ?
– Devang
Feb 2 '12 at 14:28
Depending on how your server is set up, you would just send aPOST
request containing the data. Using NSURLConnection is the simplest HTTP library to use, but there are others.
– Amit Shah
Feb 2 '12 at 14:30
@Devang so you want a SQLLite crash course AND a webservices crash course?
– AnthonyBlake
Feb 2 '12 at 15:01
I know how to check internet connection. Tell me something about syncing data
– Devang
Feb 2 '12 at 14:24
I know how to check internet connection. Tell me something about syncing data
– Devang
Feb 2 '12 at 14:24
Well, the way to do that would be to make a request to the server every so often when there is internet, and download the latest updates, and save them locally. Depending on the size of your online database you could just download it all at once.
– Amit Shah
Feb 2 '12 at 14:27
Well, the way to do that would be to make a request to the server every so often when there is internet, and download the latest updates, and save them locally. Depending on the size of your online database you could just download it all at once.
– Amit Shah
Feb 2 '12 at 14:27
oh !! and how to upload app data on server ?
– Devang
Feb 2 '12 at 14:28
oh !! and how to upload app data on server ?
– Devang
Feb 2 '12 at 14:28
Depending on how your server is set up, you would just send a
POST
request containing the data. Using NSURLConnection is the simplest HTTP library to use, but there are others.– Amit Shah
Feb 2 '12 at 14:30
Depending on how your server is set up, you would just send a
POST
request containing the data. Using NSURLConnection is the simplest HTTP library to use, but there are others.– Amit Shah
Feb 2 '12 at 14:30
@Devang so you want a SQLLite crash course AND a webservices crash course?
– AnthonyBlake
Feb 2 '12 at 15:01
@Devang so you want a SQLLite crash course AND a webservices crash course?
– AnthonyBlake
Feb 2 '12 at 15:01
add a comment |
up vote
1
down vote
use reachability class and then you can set a notifier that will notify when there will be a change of the network status
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(checkNetworkStatus:) name:kReachabilityChangedNotification object:nil];
hostReachable = [[Reachability reachabilityWithHostName: @"www.google.com"] retain];
[hostReachable startNotifier];
- (void) checkNetworkStatus:(NSNotification *)notice
// called after network status changes
NetworkStatus hostStatus = [hostReachable currentReachabilityStatus];
switch (hostStatus)
case NotReachable:
break;
case ReachableViaWiFi:
break;
case ReachableViaWWAN:
break;
I know how to check internet connection. Tell me something about syncing data.
– Devang
Feb 2 '12 at 14:24
run the web service you have multiple times?
– user784625
Feb 2 '12 at 14:38
1
@Devang How you sync the data will depend on your server and what you are transmitting. It is entirely up to you how you do this and if you ask 10 developers, you will probably get 10 different solutions. I suggest you go and think about it and come up with your own solution as this is quite a broad question to ask.
– Nick Bull
Feb 2 '12 at 15:41
@NickBull : I dont have any basic knowledge. I am just asking for basic knowledge.
– Devang
Feb 2 '12 at 16:19
@Devang Seriously, if you don't have any idea where to start with this, then I think you need to start learning some more basics of programming
– Nick Bull
Feb 2 '12 at 21:40
add a comment |
up vote
1
down vote
use reachability class and then you can set a notifier that will notify when there will be a change of the network status
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(checkNetworkStatus:) name:kReachabilityChangedNotification object:nil];
hostReachable = [[Reachability reachabilityWithHostName: @"www.google.com"] retain];
[hostReachable startNotifier];
- (void) checkNetworkStatus:(NSNotification *)notice
// called after network status changes
NetworkStatus hostStatus = [hostReachable currentReachabilityStatus];
switch (hostStatus)
case NotReachable:
break;
case ReachableViaWiFi:
break;
case ReachableViaWWAN:
break;
I know how to check internet connection. Tell me something about syncing data.
– Devang
Feb 2 '12 at 14:24
run the web service you have multiple times?
– user784625
Feb 2 '12 at 14:38
1
@Devang How you sync the data will depend on your server and what you are transmitting. It is entirely up to you how you do this and if you ask 10 developers, you will probably get 10 different solutions. I suggest you go and think about it and come up with your own solution as this is quite a broad question to ask.
– Nick Bull
Feb 2 '12 at 15:41
@NickBull : I dont have any basic knowledge. I am just asking for basic knowledge.
– Devang
Feb 2 '12 at 16:19
@Devang Seriously, if you don't have any idea where to start with this, then I think you need to start learning some more basics of programming
– Nick Bull
Feb 2 '12 at 21:40
add a comment |
up vote
1
down vote
up vote
1
down vote
use reachability class and then you can set a notifier that will notify when there will be a change of the network status
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(checkNetworkStatus:) name:kReachabilityChangedNotification object:nil];
hostReachable = [[Reachability reachabilityWithHostName: @"www.google.com"] retain];
[hostReachable startNotifier];
- (void) checkNetworkStatus:(NSNotification *)notice
// called after network status changes
NetworkStatus hostStatus = [hostReachable currentReachabilityStatus];
switch (hostStatus)
case NotReachable:
break;
case ReachableViaWiFi:
break;
case ReachableViaWWAN:
break;
use reachability class and then you can set a notifier that will notify when there will be a change of the network status
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(checkNetworkStatus:) name:kReachabilityChangedNotification object:nil];
hostReachable = [[Reachability reachabilityWithHostName: @"www.google.com"] retain];
[hostReachable startNotifier];
- (void) checkNetworkStatus:(NSNotification *)notice
// called after network status changes
NetworkStatus hostStatus = [hostReachable currentReachabilityStatus];
switch (hostStatus)
case NotReachable:
break;
case ReachableViaWiFi:
break;
case ReachableViaWWAN:
break;
edited Feb 2 '12 at 17:30
DShah
7,752961120
7,752961120
answered Feb 2 '12 at 14:18
user784625
99051936
99051936
I know how to check internet connection. Tell me something about syncing data.
– Devang
Feb 2 '12 at 14:24
run the web service you have multiple times?
– user784625
Feb 2 '12 at 14:38
1
@Devang How you sync the data will depend on your server and what you are transmitting. It is entirely up to you how you do this and if you ask 10 developers, you will probably get 10 different solutions. I suggest you go and think about it and come up with your own solution as this is quite a broad question to ask.
– Nick Bull
Feb 2 '12 at 15:41
@NickBull : I dont have any basic knowledge. I am just asking for basic knowledge.
– Devang
Feb 2 '12 at 16:19
@Devang Seriously, if you don't have any idea where to start with this, then I think you need to start learning some more basics of programming
– Nick Bull
Feb 2 '12 at 21:40
add a comment |
I know how to check internet connection. Tell me something about syncing data.
– Devang
Feb 2 '12 at 14:24
run the web service you have multiple times?
– user784625
Feb 2 '12 at 14:38
1
@Devang How you sync the data will depend on your server and what you are transmitting. It is entirely up to you how you do this and if you ask 10 developers, you will probably get 10 different solutions. I suggest you go and think about it and come up with your own solution as this is quite a broad question to ask.
– Nick Bull
Feb 2 '12 at 15:41
@NickBull : I dont have any basic knowledge. I am just asking for basic knowledge.
– Devang
Feb 2 '12 at 16:19
@Devang Seriously, if you don't have any idea where to start with this, then I think you need to start learning some more basics of programming
– Nick Bull
Feb 2 '12 at 21:40
I know how to check internet connection. Tell me something about syncing data.
– Devang
Feb 2 '12 at 14:24
I know how to check internet connection. Tell me something about syncing data.
– Devang
Feb 2 '12 at 14:24
run the web service you have multiple times?
– user784625
Feb 2 '12 at 14:38
run the web service you have multiple times?
– user784625
Feb 2 '12 at 14:38
1
1
@Devang How you sync the data will depend on your server and what you are transmitting. It is entirely up to you how you do this and if you ask 10 developers, you will probably get 10 different solutions. I suggest you go and think about it and come up with your own solution as this is quite a broad question to ask.
– Nick Bull
Feb 2 '12 at 15:41
@Devang How you sync the data will depend on your server and what you are transmitting. It is entirely up to you how you do this and if you ask 10 developers, you will probably get 10 different solutions. I suggest you go and think about it and come up with your own solution as this is quite a broad question to ask.
– Nick Bull
Feb 2 '12 at 15:41
@NickBull : I dont have any basic knowledge. I am just asking for basic knowledge.
– Devang
Feb 2 '12 at 16:19
@NickBull : I dont have any basic knowledge. I am just asking for basic knowledge.
– Devang
Feb 2 '12 at 16:19
@Devang Seriously, if you don't have any idea where to start with this, then I think you need to start learning some more basics of programming
– Nick Bull
Feb 2 '12 at 21:40
@Devang Seriously, if you don't have any idea where to start with this, then I think you need to start learning some more basics of programming
– Nick Bull
Feb 2 '12 at 21:40
add a comment |
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f9113727%2fiphone-how-to-sync-data-with-the-web-service-when-internet-is-reachable%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
do you use Reachability class?
– user784625
Feb 2 '12 at 14:13
so what you actually want is a SQLlite crash course?!?
– AnthonyBlake
Feb 2 '12 at 14:59
@AnthonyBlake: I want basic knowledge of Sync process.
– Devang
Feb 2 '12 at 16:24