iPhone:Find Wifi and Bluetooth nearby devices programmatically? - iphone

I am trying to find nearby WiFi devices programmatically from my application.
I have the following two questions.
1. Is there any API's to do this? Is there any sample provided to go through?
2. Is it possible to implement it from 3.0 SDK or 4.0 SDK?
The same thing i want to find nearby Bluetooth devices as well and want to send file using this from one device to another?
Thanks.

Have a look at Game Kit
As far as I know you can do what you want with Bluetooth but not WiFi (unless the devices are on the same wireless network). For WiFi I recommend you build your own server app that the iPhone clients advertise their location to and get "nearby" device info. Much like how Bump works. This way you don't need your clients to be on the same network.

Related

Get GPS from iPhone to wifi iPad via bluetooth?

Is it possible to transmit GPS data from a GPS-enabled iPhone to a wifi-only iPad? Does anyone have sample code to share that would do this?
How about getting GPS data from an Android via bluetooth, over to a wifi iPad?
Yes, but you would need to create an application for both devices that would communicate with each other. You cannot get the location over wifi without a custom application sending the data.
Have a look at the WiTap sample app. This app allows two devices to find each other and send data to each other using WiFi. You can adapt this code so one device sends location data it obtains to the other device instead of info about which rectangle was tapped.
I have no info for doing this with Android.

How can I connect an iOS device to non iOS device (Arduino devices) via Bluetooth?

After searching on Google, I found that people say it's only possible to connect an iOS device with a non iOS device with the 'MFi program'. Is that true?
My project is mainly focused on sending and receiving information with the Arduino device via Bluetooth directly.
Is communication between iOS and non iOS devices without jailbreak possible? If yes, is there a reference?
(I viewed Stack Overflow question How can an iPhone access another non-iPhone device over wireless or Bluetooth?.)
As I stated in the above-linked question, general Bluetooth communication to external devices on non-jailbroken iOS devices is restricted to MFi-compliant Bluetooth hardware.
However, newer iOS devices (iPhone 4S, new iPad) are capable of Bluetooth 4.0 LE communication with external devices without the need for those devices to be MFi-compliant. This interaction is done through the new Core Bluetooth framework, which lets you send and receive arbitrary data to and from Bluetooth LE devices. This only works with those listed newer iOS devices, though.
Tim points out an interesting hack that you might be able to get away with in making your device appear like a Bluetooth HID keyboard. Devices like this barcode scanner have special modes to appear as HID devices to iOS. You might be able to pull something together based on this, but all data transfer will be one-way from your device, and it looks like this will require entering that data into text fields as if you had a keyboard connected.
Alasdair Alan's "iOS Sensor Apps with Arduino" is a good resource to look at. I've used Wifi with another microprocessor (mbed) but not sure about bluetooth. Alasdair is active on Twitter and he usually is kind enough to answer questions.

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.

iPhone UDP ad hoc datas transfert

I'm trying to make an iPhone application to communicate with an other wireless device.
The other device can send datas via UDP sockets. I just want to know if it is possible to receive the informations on the iPhone, without access point on the network (just an iPhone and the wireless device), and how if it is.
I was looking at UDPecho, by apple, and I think it could be useful.
If anyone had some idea, just let me know what you're thinking about
iPhone 4 with iOS 4.3 can create a Wi-Fi network using the Personal Hotspot feature, which your "other device" could join.
A Verizon iPhone with 4.2.6 may also be able to do this.
Earlier iPhone models can't use the Personal Hotspot feature, regardless of the version of iOS.

iphone blue tooth connection

could i connect iPhone and collect data from other bluetooth device (it may be iphone , ipod, nokia or other blue tooth device, like PC and so on.) from my own application. ?
if it is possible which way is the easiest . like GameKit framework ?
pls help me
With the SDK the GameKit framework is your only choice.
You are not allowed to low-level access to Bluetooth devices, also knowing apple and their policy on connecting external devices to their iPods, it would take some kind of chip and licensing deal for a vendor to be able to connect their device to an iPhone. So I am guessing that not all bluetooth devices will be abble to connect to your iPhone