Can a file be transferred from iPhone to Mac using Bluetooth programmatically? - iphone

Can a file be transferred from an iPhone to another iPhone/iPod/iPad and to my Mac/PC using Bluetooth using a iPhone App?
I posted a question yesterday with same content. This was migrated to superuser.com.

iPhone SDK 3.0: where is the Bluetooth?
in short: no.

I have not ever tried it, but GameKit exists on the iPhone, and the Mac - as part of that you can establish a network connection between two systems locally over bluetooth. You should be able to use that connection to transfer any data you like.
What you cannot do is write an iPhone application that makes use of the standard Bluetooth file transfer protocol - that is not supported. If you are open to a custom Mac/PC client though, it will work (PC client might be a lot trickier).

Related

file transfer via bluetooth from IPhone app

In my app, i want to send a file to another iOS device via bluetooth.
I don't want to install any app from app store which using bluetooth functionality.
I want to implement bluetooth functionality in my app and once it connected means it would list out available iOS devices ( bluetooth enabled devices ) and send a file to selected device via bluetooth.
Is that possible? I don't know where to start..
Please help in this regards..if any sample code for it means its very helpful to me..
Thanks!!!
You can use the iOS CoreBluetooth Framework for this, where you can send any kind of data by converting it to NSData.
You can find Apple's demo project over here -> Demo Project
PS: If you are not dealing with much complexities in your project, then you can also check this powerful library called LGBluetooth by l0gg3r on Github . Its pretty simple!
Cheers!
GameKit is probably a good starting point as that supports peer-to-peer connectivity
http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/GameKit_Guide/Introduction/Introduction.html
Not sure if the GameKit api's support sending files, and the documentation had this to say: Note: The largest message size allowed is 87 kilobytes. If you need to send more than that, you must split your data into multiple messages.
Here are some related questions as well:
iPhone: Sending large data with Game Kit
Send and receive NSData via GameKit
Using GameKit to transfer CoreData data between iPhones
You have to implement OBEX protocol FTP (File Transport Profile) to pushing / pulling .... files from other device :) It is not easy to do !!

transfer files via Wifi in iPhone

i am looking out to check if its possible to transfer a file between 2 iPhone devices or between iPhone device and PC/Mac through Wifi.
If its possible is there any size constraint to the file?
BR,
Suppi
Use bonjour to search for devices. Then use CocoaAsyncSocket to send and receive data. It works like a charm.

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.

iPhone interaction between PC app and iPhone app using USB

I know since the 3.0 SDK we can use accessories, so my question is simple, what is the process to make an iPhone app and PC (or Mac) app interact, using the USB ?
I don't ask you any code, but just the paths and the keys for making that work.
Have I to access the iPhone disk through SSH and work with files ?
Or can I send data from the iPhone app and intercept (get) it on the PC app (and send data from PC to iPhone) ?
Thanks, and if this question is stupid, just tell me, I didn't find on Dev Center (I don't really know what I have to looking for...) !
Edit : I read some news from Microids, they will synchronize PC and iPhone games (i.g here), and somewhere (I can't find it again) they say connecting the iPhone on the USB, so I think this is possible
USB access on the phone is only supported via the External Accessory Framework. You cannot hook the iPhone up to arbitrary USB devices, the devices actually have to support the EA protocol. You can get more details about it via the Made for iPhone program.
Other than that there is no USB access available on to applications.
You want the External Accessory Framework. Having said that, I'm not sure that Apple's intention was for you to communicate with an application on a PC/Mac. It's really for talking to accessories such as iPod docks, remote controls, etc. Apple may not allow an application that talks to a PC in this manner in the App Store.
You might be interested in ssh_relay (earlier called iphone_tunnel).
There is a /System/Library/Lockdown/Services.plist on your iPhone and you can start any such services via AMDeviceStartService and then communicate with it.
The ssh_relay demonstrates how to do that by having a simple port forwarder as a service on the iPhone site and the client application on your PC, so you can forward any local iPhone port to your PC. This is not exactly what you wants here (it is handy in the case you have already another service running on the iPhone which communicates via simple TCP and you want to access that; for example SSH) but based on this example, it should be straight-forward to have any communication between the service (in Services.plist) and your PC.