I need to build a networking application for talking to a Mac from an iOS device.
Basically I'm trying to write a remote-control type of application for my Mac, and will need to send things like mouse-movement and keyboard-events.
But to start with, how do I talk to the Mac over the network, what API's or technologies should I use from the iOS device to do this with?
This tutorial on networking with Bonjour is gonna help you get started.
Related
I recently developed an application for a client, an app iOS, Android and windows, the mobile app acts as a controller and launches certain events on the windows application. The Windows application also shares data at random (not known to the mobile app) moments. The communication was done by TCP. And works great.
The client now wants it for bluetooth. Between Android and Windows, it's not been a problem and has been done, and works well. But iOS is sadly not the same story... The use of Bluetooth low energy seems to complicate things.
I've hunted high and low on google to find anything on communication between a .net application and a Swift application, to no avail. This surprises me that no one talks of a bluetooth communication between Windows and iOS.
My question is, very simply. Is it possible? I know very little about bluetooth and I've tried researching devices and all I find is a BeeWi device that's in our office, not my computer (I maybe need to launch something on computer first? The devices are paired)
My computer has a Bluetooth 4.0 dongle and the BLE emulator is present in the Device manager.
If this isn' possible, tell me know and put me out of my misery, otherwise give me hope!
Any additional advice is warmly welcome - Thank you all !
Beau Carrel
Windows has support for being a BLE client. Just Google it and you'll find many examples, such as https://developer.microsoft.com/en-us/windows/iot/Samples/BLEGatt2.
You need to set up iOS to be an advertising peripheral.
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.
I wanted to make an application for the iPad that will be controlled from an iPhone-app. Is there a possibility to access the PhoneGap-App on the iPhone?
I don't want to use an external server because the app should run offline in an Ad-Hoc network.
First I thought of creating a local webserver on the iPad, but I couldn't find anything PhoneGap related. Any Idea?
You were probably on the right track with the web server idea.
I am not sure how well the various solutions are supported in PhoneGap, but I would think you could use some sort of WebSockets implementation for the bi-directional communication between the iPhone and iPad apps.
In an effort to learn more about networking I'd like to do an exercise: write some code on an iPhone and macbook laptop that allows the devices to communicate over HTTP.
How would I set this up in general? I could write a very simple web server as illustrated in Beej's Guide. Then run this and make requests from the phone. Assume the two devices will be on the same wifi network.
In this book you can find an example of how to make a network to connect a Mac OS X app with an iOS app using Bonjour.
http://my.safaribooksonline.com/book/programming/mobile/9780132757058/bonjour-and-web-servers/ch28
Hope this helps you.
Using HTTP between two apps is very inefficient. Use NSNetService and raw sockets.
NSNetService Docs
There is an example project that shows how to setup the service for publishing, connect 2 services, and consume data from a socket connection.
I want to know whether there are APIs or other methods to communicate with Mac OS X and iOS. I have googled the problem and found no results. Moreover, someone said there is no official support for it. Any help would be appreciated:)
You can use just about any network protocol from Bonjour to ZMODEM to communicate between an iOS device and a Mac. HTTP is, of course, one very popular choice. As a bonus, most options work equally well to talk to devices running Windows and unix-y operating systems.