communicate between iphone and windows pc? - iphone

I want to write an app to communicate between the iPhone and a Windows pc. Where can I find more information on that particular communication?

Your best bet I beleive is to just use the network. If you're doing something nice and simple HTTP might even work for you. If you need to transfer files they NFS or FTP.

I found the following link:
Bonjour for .net
I tested the sample app and it communicates with my iPhone. I will digg more in that on the next day or tow and will inform you.

Related

Communication between two iOS devices

I am looking for a way to have one iPhone app send a message to another app on a different phone (sort of like a Sender-Receiver set up). I am looking for the best possible way to do this. Does anyone have any ideas and/or tutorials?
Thanks for the help.
You should use GameKit. It is super easy to send messages between two iOS devices using it. Here's a great tutorial: Game Kit. You can also get more information about it here from the docs: About Game Kit.
You communicate by creating an ad-hoc bluetooth or local wireless network.
lmirak provided insightful info about device communication(especially about GameKit). I would like to add one more solution. You can use WiFi network to do your device communication.
See the link or download the sample application from developer.apple
The sample application named as WiTap. It demonstrates how to achieve network communication between applications. Using Bonjour, the application both advertises itself on the local network and displays a list of other instances of this application on the network.
If your app is only going to run on iOS, then you should use the fantastic MultipeerConnectivity library. https://developer.apple.com/documentation/multipeerconnectivity
If you need a solution that will work cross-platform, then one way to accomplish this is using sockets and connecting over a local network. On iOS you can use CocoaAsyncPods for sockets and NetService for discovery.
Here is a basic example app that does this: https://github.com/brendaninnis/LocalNetworkingApp
, which I explain in great detail here: http://brendaninnis.ca/connect-nearby-devices-part-1.html

How to create a Mac/PC server app that interacts with iPhone/iPad App?

Can someone please point me in the right direction to create a Mac/PC server app that runs in the background and connects to an iPad app over the local WiFi network?
No matter how I phrase a search on Google it just brings up various apps like Remote Mouse and whatnot and no tutorials or even a hint of where to start.
I just need to send simple commands from iPad to computer over local wifi. A point in the right direction and I can likely fill in the blanks.
Thank you.
Thomas
EDIT: I am using web languages for the iPad version that I will build as a native app using open source tools.
OK, then. It actually depends on what you really need. I made the assumption you need real-time and perhaps binary data transfer.
Your best bet is to write your server application using standard C or C++ so it compiles on both as simply as possible.
If you want to avoid all the burden of writing a protocol for service discovery or asking users to enter the ip address of your server you will use a mDNS implementation for your server and your iPhone app.
If I were you I would try bonjour: http://www.apple.com/support/bonjour/
on iPhone You could start here: http://developer.apple.com/library/mac/#documentation/Networking/Conceptual/NSNetServiceProgGuide/Articles/PublishingServices.html
Once you have your sockets you will have to implement a networking protocol between your server application and your iPhone app.
You will have to be careful about byte ordering and little subtle problems with latency, disconnections and other problems inherent to networking and WiFi.
In windows you will want to register your application as a service and in Mac OS X/UNIX you'll probably want to deamonize it.
Good luck!

Publishing a MIDI source as a Bonjour service

I have written a VST/AU/RTAS synthesiser plugin for OSX and Windows that also has an iPhone equivalent. I would like to allow the two to communicate with each other over a local area network so that the iPhone app can be used to send MIDI controller data to the plugin. I plan to create a MIDI source on the iPhone and publish it as a Bonjour service so that the plugin running on OSX or Windows can find it and receive midi from it.
I have a couple of questions to ask about this:
1) Do I actually have to publish the MIDI source as a Bonjour service or does a coremidi host (running on iPhone) automatically publish itself?
2) Are there any code examples available that show how to do this sort of thing?
I have seen the following post but the answer to this only covers the client side, finding a Bonjour service but not the publishing side, and it transmits MIDI via OSC, and it only covers OSX but not Windows (I know, I'm not asking much! ;) )
How to send MIDI or OSC signals to a Mac application from my iOS application?
Cheers,
John.
AFAIK you'll have to publish the service yourself. NSNetService and NSNetServiceBrowser are the classes you need. Check out the companion guide. I found this article on Cocoa for Scientists particularly helpful in getting started. Both have some decent code samples. The Bonjour Browser is useful for testing.
The list of bonjour service types already has
apple-midi
and
imidi
But I think it's best to make up your own application-specific type name unless your app is plug-compatible with one of these services.

How to Share Files Between my iPhone App and a Mac/PC

I have developed an iPhone app which stores photos in the /Documents directory of my app.
I would like to add a feature which gives to the user the opportunity to transfer those pictures to his/her PC or Mac.
I don't really know how to do that.
What is the best way, using Bonjour, bluetooth, or directly USB (if it is possible) ?
I really need some advices on that point ...
Any ideas ?
PS: Forgive my English, I am French :-)
Try NSNetService to register the service in Bonjour, and NSFileHandle to send data over a socket connection associated with the service.
If you do not want to write a Mac or PC part for your app then you can also consider to build in a little http server that people can use to access the data in your app. There are some nice open source http servers available for Cocoa which you can find with Google.
Using Bonjour you can advertise your http server so that people can easily find it with a Bonjour enabled browser like Safari. (Your iPhone app's web server will appear automatically under the dynamic bonjour bookmarks items)
You've edited the question to say that it's about transferring photos. Could you store the photos on the iPhone's photo roll with UIImageWriteToSavedPhotosAlbum(), and let Apple handle getting them onto the computer?
Bonjour!
I mean that both as a greeting and an answer. You have to setup a bonjour connection over wifi to transfer files directly to and from an app. That's actually pretty simple to do on both the iPhone and Mac side. The PC is a little tougher.
You can do bluetooth but bluetooth capability is still fairly rare on desktops.
Without knowing more about your specific application, I agree with Graham Lee--either directly saving to the Camera Roll or giving the user an option to save one or more photos to the Camera Roll is much simpler than http/bonjour.

how to export data to computer(PC) using wifi or http connection?

I have made Iphone applicatio. In my application whatever data i have recorded; all that data i want to export to the Computer using the application.
Is there any way available to sent data to computer using wifi using developed application? Can we use Bluetooth or Http connection to send application from device to the PC?
if we can than how can we manage the bluetooth and how to use it without Jailbreaking?
if any body has any solution,please give any code or any link or any other solution which would appreciated.
Thanks,
Mishal
Your best bet is to send the data using HTTP or FTP to a server, which could be your PC. Would that work for you?
Here's one way to do it.
Here's another.
And one for FTP.
I dont think you have an option to gain control of a computer and toss a file in there from within an iPhone app. You cannot do it over the usb cord, you cannot mount the drive unless you roll your own fs mounter (pretty difficult), and you cannot push a file over html or something and have it magically appear. The user would have to interact at some point.
Many times, this is done over html. In my apps, I use CocoaHTTPServer to get local info into and off of the phone. You run the server and out-of-the-box, it indexes all the files in the documents directory for you to download from any browser on the same wifi network. Give it a shot as it is a easy to implement solution for getting large files off the phone without having to resort to something clunky like email