iPhone/iPad: Transfer Files To/From Device? - iphone

Locked. Comments on this question have been disabled, but it is still accepting new answers and other interactions. Learn more.
Does Apple offer an API or Kit so that I can start my program on the Desktop and transfer files to/from the device (using the desktop program)? The device will have a similar program/sandbox available. I'm trying to avoid requiring the user to run iTunes, DiskAid, or similar program.
I found an earlier answer [1], but it stated to use cocoahttdserver. Shooting from the hip, a http server feels 'wrong' (in the Windows world, I have the Ce Rapi gear [2] to do the same).
Note that I only need to transfer to a single sandbox on the device - not an arbitrary sandbox. If needed, I have both Mac and iPhone developer accounts (for signing, sharing, and other sandbox nicities).
Jeff
[1] iPhone : Transfer of files from Mac/Pc to app
[2] http://msdn.microsoft.com/en-us/library/ms860198.aspx

Sorry, but your options are wireless network transfer or iTunes. Of the wireless network transfers systems, if you need to be able to transfer over the local network HTTP+Bonjour is the best route.
Advertise your service on your desktop computer using a custom service type and use searchForServicesOfType:inDomain: on iOS to match only those services.

Related

Device Wifi Setup Walkthrough

Most electronic home goods today are able to be setup through a webpage to connect the device to a home network. Usually there is some sort of bluetooth or wifi direct finding mode to access the device and then using a webpage or app the device is given the SSID/password for a wifi network and then you're off to the races. What is that tech called? I would like to replicate the setup experience with a generic IoT device running linux. I just don't know what that process is called to start digging into how to do it.
Bluetooth and Wifi-direct specifications are (consumer-usage-wise) public-domain knowledge, just setup a temporary open server and accept any connection after each hard-reset, and do what you have to do like here (BT) and here (Wifi-direct). There are other proprietary technology like TI CC3000, which usually relates to specific hardware solutions.

about file sharing in iphone sdk?

i saw one application in App store.(files lite by olive toast). inwhich they have used
web server(webDAV url) to transfer file from PC to ipod or iphone and also another option bonjour.how can i use bonjour (what is it ?)..how can i do for my application?
internally how they have done?any help please?
Bonjour is Apple's "Zero-configuration networking". Essentially it allows you to advertise a service on the network by name, allowing other machines on the local network to discover it. There's plenty of high quality documentation available from Apple. Just google it.
Bonjour is just a way for your desktop application to discover the ip address of the iPhone. To actually transfer data to or from your device, you need to write that code yourself. Unfortunately Apple doesn't provide a framework to do this.
Some people use WebDAV, implemented with an open source framework.
Another option is to use ZSync, if you are using Core Data:
http://www.zarrastudios.com/ZSync/ZSync.html

How can an iPhone communicate with a computer?

How do apps like Apple's "Remote" app control mac applications and send data?
is this via php with exec() commands or some other method? and how would I do it in c?
Also, how fast is this rate of transfer (can I use it to send real-time data like streaming video or audio?)
thanks to anyone who cares to enlighten me on this issue :-)
Apps generally communicate using a TCP/IP based protocol and the wireless LAN connection (the iPhone also has Bluetooth). In the case of the Remote app the communication is via with the Digital Audio Control Protocol. iTunes implements DACP so the Remote app can control it. Other common protocols are HTTP and FTP. There are classes in the iPhone SDK to connect to noth HTTP and FTP servers. There is also the Cocoa HTTP Server project which allows the iPhone to act as a HTTP server.
iPhone apps can also use Bonjour/mDNS/zeroconfig (they're different names for the same technology) so that the user doesn't have to be concerned with configuring IP address'.
The data transfer rate of the wireless connection is faster enough to stream video.
many of these remote applications work by installing client software on the computer and establishing a network connection. In the case of Apple's remote software, the client software is built into the networking capabilities of iTunes. You must authenticate using your iTunes sign in and be on local wifi.
The third party app "intelliremote" works very similarly only has it's own client software to install and can work across a WAN with proper port forwarding enabled on your network.
I haven't encountered any realtime streaming options as most of these utilities are designed to pass control messages and meta-info on media files.

Secure iPhone-Desktop Connection

Background
There are a lot of App Store released iPhone apps that require an IP based server on the desktop so that the iPhone can connect to the desktop as a client. For example, there are many programs that emulate a keyboard, touchpad, or Apple remote on the iPhone so that a desktop computer can be controlled over wifi. However, many of these applications get around writing their own server by requiring the user to install some VNC server variant.
Question
What is the best way to implement a secure (encrypted) IP server on a desktop (Mac and Windows platforms) that allows for simple two way message passing between itself and an iPhone client on a wifi network?
Sample Use Case
An event on the desktop causes the desktop to push a small image or text to the iPhone. An event on the iPhone causes a short text message to be pushed to the desktop. Any single event can happen at any time (doesn't appear synchronized to the user).
1st Follow-Up Question
Would this type of project be best handled using something like XML or JSON over HTTP? Or is there a better protocol, like BEEP or Bonjour(XMPP)?
What is the best way to implement a secure (encrypted) IP server on a desktop (Mac and Windows platforms) that allows for simple two way message passing between itself and an iPhone client on a wifi network?
Not sure if there is a "best" way, but much code is already available to do xyz-over-HTTPS (TLS/SSL). In that case, the "xyz" can be any web-based message exchange protocol, such as XML, JSON, etc. via REST or SOAP, etc.
If you want to be able to push events to a non-jailbroken iPhone you can't do it other than via Apple's Push Server which causes a notification to the client program if it is running or otherwise displays an alert of some kind to the user.
Typical architecture has those notifications handled by the client program as an indication it should go and get some data from the server - Apple insist we do not regard the notifications as trusted delivery.
I suggest a read of this article on using Bonjour and local networking, whilst it's iPhone to iPhone it should apply to desktop OS/X also.

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.