Ios filesharing without iTunes or an internet connection - ios

I am working on developing an enterprise application for ios 7 that needs to work offline and then sync with a desktop client (that I also need to write) for data transfer.
My company does not allow wireless or cell data in this area, and would strongly prefer to not use iTunes either.
The question is, how do you transfer data from an iPad over the usb cable to a custom windows program, without iTunes.

The simplest answer would be: iExplorer (http://www.macroplant.com/iexplorer/) plus some kind of a script to automate the data sync.
Otherwise, you can use the ExternalAccessory framework to communicate with the desktop via a USB tether. This would necessitate a desktop client running simultaneously to communicate with the device.

peertalk (https://github.com/rsms/peertalk) does what you want, however the computer side library is only for mac os. Maybe you can port the protocol to windows by looking at that (the license is BSD)
Edit: this guy managed to have it run under linux. It sits on usbmuxd, which also has a windows port, so it shouldn't be impossible.

Related

Mirror MacBook Desktop on iPhone?

I was wondering if anyone have any ideas of how you could mirror a MacBook desktop on to an iPhone. I'm not looking for an app to install but a way to program it myself. What would be the best approach?
And to clarify, I'm not looking for a way to mirror my iPhone to my computer, but the other way around.
Thanks for any answers you might have
What you are talking about can be achieved in a number of ways. You need a server component running on the MacBook, which vends a video stream of the MacBook display(s) over a suitably secure network connection, and your app on the iPhone behaving as a client to this video stream. VNC (Vertual Network Computing) is the established, open, system for doing this. Conveniently macOS has a built in VNC server (Screen Sharing in the Sharing preference pane), so the server side is already done. Your app will need to implement the VNC client. I suggest you start by looking for existing open source implementations for this functionality, http://cocoapods.org

ASCII code on an external device through USB port

Is it possible to send an ASCII code on an external device through USB port using IOS API? I assume that it is possible through bluetooth connection, but I'm not sure through USB connector. Any thoughts?
I would appreciate if someone could put me in the right direction.
Thanking you in advance
That largely depends on the level of sophistication of this "external device". If this external device is just a bare metal embedded device without some sort of operating system you definitely need MFI.
Otherwise, you can run a usbmuxd server (e.g. on Raspberry PI with Linux) to establish a connection via USB. Usbmuxd is basically the technology that Apple uses to communicate between iOS devices and Desktop apps such as iTunes or Xcode. And yes, it is App Store compliant, e.g., Duet Display uses this approach to make an iPad a secondary display for your Desktop via USB.
There are several open source libraries that provide a high level API, e.g., PeerTalk or DarkLightning.

How does this iOS app communicate over the USB port?

This app promises to turn your iOS device into a second monitor and uses the standard USB cable to connect to the computer, as opposed to the network which all other similar apps use.
Back when I heard about it, it wasn't yet available so I thought it was a scam. To my surprise, they released the app and it actually works as described.
How does it work ? As far as I know there are no APIs to drive the USB port in iOS, and the computer connected via USB through the standard charging/syncing cable doesn't count as an MFI accessory.
Note that they provide the server software (the one that installs on the Mac and streams the desktop to the device) on their download page for free, reverse-engineering it could shed some light on this but I unfortunately don't have the skills for that.
Dean told about it on his blog.
Duet uses Peertalk, an open source library allowing to pass TCP connections through the USB connection without being part of the MFI program.
The information, code and tools to accomplish generic USB port communication is available to those who join the Apple MFi program. You have to do the paperwork and get licensed by Apple.
http://developer.apple.com/programs/mfi/
The libraries necessary are included in the app and then the usual streaming libraries and code do the rest.

Is there an API that lets one sync an iOS app with its OSX counterpart via USB?

I am developing an iOS app, which may need to sync a large amount of data with its OSX counterpart app, and for the use case in which the app would be used there may not be an internet connection available to connect either of the devices (iOS device & Mac).
Is there an official apple api that lets one sync data between an iOS app, and its OSX counterpart, without having to use the internet or iCloud ?
As far as I can tell, short of joining the MFI program, there isn't a way.
If you don't mind the user dragging some documents around, then you can create documents which can be accessed via iTunes: http://www.raywenderlich.com/1948/itunes-tutorial-for-ios-how-to-integrate-itunes-file-sharing-with-your-ios-app
What makes you think you need an Internet connection for WiFi?
If you are close enough for a USB cable, just create a WiFi network from the Mac (WiFi icon in the menu bar, "Create connection..."). Use bonjour to discover services, and then the apps can talk to each other.

How to communicate with USB protocol for an MFI accessory

I have bought an iSpread (http://www.photofast.tw/iFlashDrive2013_1.html?pid=132) which allows me to put files on it via USB on my PC. Now those files on the USB I would like to transfer to my iPad. I know that there is an application for that developed by the creators of the iSpread but for an application I'm creating I would need this integrated into my own application.
I have downloaded the EADemo application and installed it on my iPad. There I can see that the accessory is attached and that it uses the tw.photofast.cr protocol.
How do I get a list of the files and transfer them? I assume that since this USB works on my PC that it uses a standard USB protocol. I'm able to send strings and hex data to the accessory using the EADemo application but no bytes are received.
Anyone have experience with this?
You'll need to know the protocol their app uses to communicate with the accessory.
They might give it to you, if you indicate you're willing to sign an NDA and they think they can benefit from the transaction. Some hardware manufacturers offer an SDK in the form of a static library.
If you really wanted to try to reverse engineer it, a good start would be to jailbreak your phone and run their app with gdb attached so you can poke around.

Resources