How to programmatically start 3g connection on iphone?
Asked Answered
S

3

0

how to programmatically start 3g connection on iphone?

do I need to use socket api?

Semasiology answered 7/2, 2010 at 19:21 Comment(0)
B
3

You don't need to. You just access whatever resource you need from the Internet, and the phone will handle connecting in a suitable manner. If you want to know whether there is a connection at all, and if so what kind is being used, there is an API and a sample from Apple. Also see Apples iPhone Network Access: Best Practices.

Bonine answered 7/2, 2010 at 20:57 Comment(0)
R
2

The iPhone SDK abstracts out (in most cases) your connection type. You cannot choose to use wifi vs 3G vs EDGE vs Bluetooth. It might be possible if the device is jailbroken, but it's not in the SDK.

As far as I'm aware, the only time you can explicitly use a certain kind of connection is when using the GameKit framework and it forces you to use a Bluetooth connection.

Radish answered 7/2, 2010 at 19:24 Comment(2)
Well if i have an ip address fron the en0 interface, i know this is wifi and if pdp_ip0 i know its cellular. So depending on which ipadress my app uses i can choose the interface.Semasiology
@DaveDeLong is this true for both Objective-C and C socket ?Scherman
C
0

You can't programatically start a 3g connection.

You app should be aware of the network status whether it be EDGE, 3g or WiFi.

Cymene answered 7/2, 2010 at 19:23 Comment(1)
ok but how to connect to 3G if the phone isn't already connected or is 3G always on if you have a cellular connectionSemasiology

© 2022 - 2024 — McMap. All rights reserved.