views:

56

answers:

1

Hai to all In general cases if we want to get the data from any URL ,using internet or Wi-fi we will hit the url and parse that data and use it. But in the application what I am doing, I need to use pdp_ip0 cellular network only even though the wi=fi is available. So ,could any one help me how to use cellular n/w. Thank you all.

A: 

Using Reachability classes. You can check your device network (wi-fi or cellular ) and based on that you can allow to download data.You can go here :- http://developer.apple.com/iphone/library/samplecode/Reachability/Listings/Classes_Reachability_h.html#//apple_ref/doc/uid/DTS40007324-Classes_Reachability_h-DontLinkElementID_5

sandy
ok thank you very much for your response. Yes I have seen 1 app which uses reachability classes . when running it if network is not there it just throwing the alert box . Could you please post a sample code that using cellular network how to get the data from URL and necessary settings to do. Thank you so much for Your help Sandy
ratna
Getting the data is not dependable on network. Before sending the request check network status according to your requirement. Just go through the reachablity classes . It calrify how to check network.
sandy
In the app what I am going to develop should use cellular data network that gets data from an url in background(even though wifi is there). so i should connect to cellular data network and should data from URL(without using NSUrl class)
ratna