Send data from iPhone using 3G connection - iphone

I have a Java Applicaction in where I have a TCP Server that accepts conections with Sockets. So I have done a Socket in C inside the iPhone app to send a String to my Java app and when I use the WiFi connection everything works perfect.
I type a string in a textfield in the iPhone app, I press send button and I recive that string on my Java app. But when I turn off the WiFi and I try with the 3G connection nothing happens. What I need to do to get that? There is a differente socket or method to do that?
Thanks in advance.

I think both should work the same. take a look a this:BSD Sockets don't behave in a iPhone 3G environment
Maybe you are using the BSD sockets, those don't activate the 3G radio.

Related

Communicating with Windows from an iPhone/iPod

I'm looking to work on an iOS app that would need to send/receive data back and forth between the iPhone/iPod and a service that is running on Windows. Communication-wise, I will be using sockets.
The Phone will send/receive data to/from a Windows service (NOT a web service)
Sockets will be used as a means for communication
The iPhone/iPod will be connected to WiFi using a static IP address
The iPhone/iPod is intended to be as thin client as possible
The intention is to have the Windows Service listen for events from iPhone/iPod. Example:
Input needs to be taken from a UITextField and saved as a string by pressing a button. On the button press, an event must be fired and sent to the Windows Service over WiFi, which will then receive the event, perform a "server-side" action, and send the response back to the iPhone/iPod.
I'm pretty new to iOS development still and I know this is some more advanced stuff, but any help or resources that would help to accomplish this, I'd appreciate it.
Thanks!
This is standard network stuff not related to which platform you're using. On iOS you can do either:
1) use berkley sockets (standard unix stuff).
2) use the Cocoa wrapper for sockets (NSSocketPort etc).
3) use a framework such as MKNetworkKit (here).
I would use option 3 myself :)
One thing in your favour is that Windows machines and iPads are both little-endian, so you don't have to worry about byte-swapping (which you won't anyway if you're just sending strings).
EDIT: For windows to discover your device, you will need either a configuration setup with the IP address details, or to use Apple's bonjour service, or some custom solution.

Exchange data between Iphone (App) and gsm modem

Im' trying to implement an App which is able to conect to a remote GSM Modem.
To etablish something like this I need a dialin process in the app which call the "Phone number" of the remote Modem and exchange data with it. On the GSM Modem is no posibility to connect the web. It can only accept incoming calls and response.
Does anyone know if there is a practiacal solution?
No not really, there is no way to use the any of the phone functions (meaning voice/data) other the internet connection.
You can't dail a number and then send data of the line, because as soon as you dail the phone app closes you app (or backgrounds it) and takes over.

Ethernet connection to iPhone simulator

I am trying to make a program that receives UDP data on a port that the user can choose. For this i am using asyncUdpSocket.
I could not find it but i believe there is a way to send data from your mac to the simulator. Can anybody tell me how to do this?
Thanks!
It seems that you can just call the simulator on the ip adress of the mac you are running on.
Sorry for bothering everybody.

How can I create a small Mac app that receives data over the WiFi network from an iOS app?

What I need is to have a simple screen in this Mac app that just prints a string as the iPhone is transmitting strings through the WiFi network.
This string is simply a string value from a slider being adjusted up and down by the user on the iPhone. The data will be sent to the Mac app and then the Mac app will receive this signal from the WiFi network and simply print the values.
This is a constant connection. I'm not trying to sync once. I'm trying to listen to the iPhone device from the Mac to see if the iPhone is sending any more strings as the user slides the UISlider up and down from the iPhone app.
How can I create the client side? Do I need to use Bonjour or something?
In my answer to this question, I provide a link to a sample application that has a Mac component and an iPhone one. These components communicate between one another over a WiFi network, with changes in a label on one being reflected in the other. This is done using Bonjour discovery and the standard networking APIs.
With simple modifications, this could be used to send the continuous updates you need for your particular case.
Use the CFNetwork framework, you can use bonjour for discovery and then handle a persistent connection through native sockets for passing data back and forth.
http://developer.apple.com/library/ios/#documentation/Networking/Conceptual/CFNetwork/Introduction/Introduction.html
Here is an excellent tutorial to get started, its for iOS but CFNetwork is available in OS X too.
http://mobileorchard.com/tutorial-networking-and-bonjour-on-iphone/

iPhone - Browsing iPhone files through computer

I want to be able to send files from an iPhone app to a computer. What would be the easiest way of doing this?
I've made simple server client programs before, but in those, the client has always needed to connect to the server before being able to receive messages from it. There is an app for the iPhone called iSimulate, where you put a server on a Mac (the iPhone simulator), and then you use the iSimulate app of an iTouch or iPhone to send touch events to the server. This app does not require you to type in an ip-address. Instead it presents a list of available computers that have this server up and running.
How exactly is this being done? Can a server broadcast a message over a network, w/o anyone being connected to the server? How does that work? How does a client listen for that broadcast?
Here's a video of the app I'm talking about:
http://www.youtube.com/watch?v=N3Qpd1ycZh4
alt text http://a1.phobos.apple.com/us/r1000/051/Purple/7b/07/70/mzl.mvwjifyc.320x480-75.jpg
That app may be using Bonjour.
I've seen similar apps use a peer-to-peer Bluetooth connection to exchange files between a iPhone and a desktop.