how can iPhone work as usb device? - iphone

I notice that there some apps make iPhone become a remote mouse or udisk.
I guess it change iPhone into a usb device.
but I really hope to know the mechanism of these app.
Is there any sample code to help me to understand?
Thanks
interdev

These generally work over WiFi, when the computer and phone are on the same network.

Related

Bonjour data sending multiple devices

Does Bonjour allows one iOS device to send data or image to multiple iOS devices at a same time?
I am able to detect number of iOS devices over a wifi network. But the problem is coming in sending data or image to more than 1 iOS device at the same time.
Should i go for gamekit bluetooth approch for the above problem? Sample code for the question will be appreciated, and help is always welcome.
Yeah I think you should use Bluetooth to do the thing mentioned in your question.
Here are some of the samples. Please have a look:-
http://vivianaranha.com/apple-gamekit-bluetooth-integration-tutorial/
http://mobile.tutsplus.com/tutorials/iphone/bluetooth-connectivity-with-gamekit/
It may help you, Thanks!

how to get ios devices' information nearby with Bluetooth

How could I set the ios devices' (iphone & ipad) bluetooth visible for other ios devices when turn the bluetooth on?
I just want to get and show all the ios devices' name (MFI devices include) nearby in my app when all devices' bluetooth on, and I also want to get devices' deviceID.
I have succed using GameKit.framework to connect two ios devices by using bluetooth, but this requires the two devices run that app together.
Could some one provide me suggest on how to implement it? Thank you very much!
i my self have not worked on it, i know its not good to give link here.But hope these links will get u to start on your-self:
http://www.touchthatfruit.com/ios-bluetooth-development-tutorial-using-game
http://vivianaranha.com/apple-gamekit-bluetooth-integration-tutorial/
http://www.devx.com/wireless/Article/43502/0/page/1
http://developer.apple.com/library/ios/#DOCUMENTATION/NetworkingInternet/Conceptual/GameKit_Guide/Introduction/Introduction.html
happy to help
I'm not exactly sure what you are asking. Setting a device's bluetooth on is not enough. A device needs to be advertising for peers to detected it. I think this might be related to what you are trying to do: http://www.ralfebert.de/tutorials/ios-swift-multipeer-connectivity/.
I tried this tutorial and it was very helpful. It uses Multipeer Connectivity to advertise and browse for peers around. It also displays the deviceID of devices around you.

An application to check iPhone connection with USB

I want to know if an iPhone is connected to USB programmatically.
So far by googling i found http://developer.apple.com/programs/mfi/.
Do I really need this api to find out whether an iPhone is connected to USB device?
I just want to make an iPhone app that prints out in console whether the iPhone is connected with USB or not.
Thanks much.
You might be able to use the solution from this question.
The solution detects if the device's battery is currently being charged which, if connected to USB, most likely will be unless it is a 3rd party accessory in which case there's a different SDK for those I believe.
In any case, if the solution isn't helpful it might point you in the right direction.
UPDATE:
Did some more digging and it appears that this may not be possible other than the battery charging solution mentioned previously.
So to answer your question "Do I really need this api to find out whether an iPhone is connected to USB device?":
Yes, it appears that way.

iOS and Infrared

Is it possible to communicate with an Infrared device (USB Infrared, TV, Mobile Phone, etc) using iOS (iPhone or iPad)?
Well, i know it's possible, since there are many remote/universal remote applications in the AppStore. I basically want to know how?
What are the limitations and
requirements?
What kind of additional hardware is
required? If it's available in the
market?
Which protocols should i know about?
Which iOS libraries can help me in
the process.
Can anyone point me in the right direction. Thanks.
Any devices using IR for controllers are either wifi or have custom hardware that outputs IR signals based off of output from the device. So without using your own hardware, I don't believe this is possible
Infrared isn't unbuilt in iPhone. All those remote apps are wifi based.
The hardware isn't available but there is a hack you can make to the headphone socket.
http://arstechnica.com/apple/news/2011/01/project-hijack-uses-iphone-audio-jack-to-make-cheap-sensors.ars?utm_source=Ars+Technica+Newsletter&utm_campaign=05bfd22285-January_21_2011_Newsletter&utm_medium=email
There is no infrared connectivity within iOS.However there are bluetooth and wifi.Generally you can use bluetooth functionality by importing GameKit framework.Thanks

Is iphone simulator geolocation features working with the Ethernet/Wired network connection only?

I'm trying to develop an iPhone application which uses the geolocation libraries. Is this feasible for the iphone simulator to simulate the GPS functionality without the use of my PC's Wi-Fi infrastructure? Does anyone know if the iphone simulator can spot your location using your IP-address only (so only the Ethernet cable connection is required)?
Thanks in advance.
You should test that functionality on an actual device. I believe the simulator will always show Cupertino, CA as the location.
No it won't work using ethernet. Core location appears to only work with WIFI even though at the end is the same router.
CoreLocation doesn't work in the simulator, but there are options
http://github.com/futuretap/FTLocationSimulator
Simulator doesn't have this functionality, but iSimulate has (it's not mine :-( ). It connects the device and simulator per WiFi and sends location events to the application within simulator: real GPS events and a few predefined locations around the world. Pretty cool!