iPhone and it's wireless area - iphone

Is there a way to discover other iPhones in the range of it's wireless area? So I give an example. I am staying at the airport. Somewhere near me there is also an iPhone. Me and the other iPhone's owner playing the same game. Is there a way to alert me and the other player that we are so close to eachother? Is this working also if we aren't on the same wireless networ, or there aren't any wireless?
And if there is a way to do this, can you give me some start point? Like a link where I can learn the basics or something like this. Maybe the name of this procedure, because I either don't know how to search in google about this topic. Thanks in forward!

The peer-to-peer discovery and connectivity you're describing can be accomplished with Game Kit framework.
Originally I thought it only worked via bluetooth, but after quickly looking over this GameKit Wifi question it seems wifi is also supported.
Hope this helps!

Related

Control Camera desktop application using Gyroscope of Android smartphone

For a project at my university I need to create a Unity3D application on my laptop, in which the camera is stationairy and can be controlled to rotate in any direction using the gyroscope of my Android smartphone (Nexus 5), wirelessly or through usbcable.
I've looked at the possibility of OSC or the Unity Remote 5 App, but up till now haven't found a way that works in order to obtain this result.
Any help or advice would be hugely appreciated - I don't have much experience yet with all this.
Thanks!
If i was going to do this then I would use UNET (Unitys built in multiplayer networking API) and have the rotation sync over LAN.
On the camera I would have a Network Transform and a script to control its rotation based on accelerometer input.
The version on the phone would be the authority and sync it's rotation over the network to the client on the laptop.
Pros: Wireless, fast (over wifi), very little code required to make it work, lots of documentation available online.
Cons: Relies totally on your network situation, you will have to do a lot of trial and error to get a smooth experience (not jerky) i think.
As for getting the tilt input on the device, Unity have a great tutorial here: https://unity3d.com/learn/tutorials/topics/mobile-touch/accelerometer-input
It's pretty straight forward.
Sound like a fun project, good luck!
It's possible to do this via cable, WiFi, Bluetooth 2.0 or Bluetooth 4.0 (BLE). I have implemented what you need in WiFi and Bluetooth 2.0 for my current work.
It's pretty easy to get rotation values and stream them from Android but I don't think you will need to do anything because you can just use this!
https://play.google.com/store/apps/details?id=de.lorenz_fenster.sensorstreamgps&hl=en
So the question is how do you receive the data this is sending on Unity's side. The answer is the UdpClient class.
If you need more reliability because every second student in your uni library is torrenting Mr. Robot and your getting huge lag then I can tell you how to implement the same thing in Bluetooth, which is not super trivial as .NET 2.0 (which unity uses) doesn't support bluetooth libraries, but there are solutions...

Wi-fi capture packets IVS.

(^.^)"Hi again sorry for my English is not good if someone like correct my redaction I would appreciate this"
Hi, is anybody now if I can capture IVs with my iphone from the wi-fi networks , any source code, Api, tutorial, etc.. who can make this who can put the iphone wifi promiscuous mode monitor to capture packets.
I've looking for but can not find nothing.
Thanks.
Take a look at Stumbler.
Note that it uses private APIs so most of this code is not suitable for
App Store aplications. But as a learning resource it's priceless.

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.

Multiple peers connected

I'm developing a game that requires up to four iPhones or iPod Touch to connect each other to play in turns.
My question is, how can I accomplish this via GameKit. I've read that using client/server sessions is the way of doing it. But I can't find any examples that would illustrate this.
Is it really possible to do it, or there can only be two devices connected at a time.
I'd really appreciate if you all could help me with a code sample.
Thanks.
What you are trying to do is possible with the Gamekit framework. Easiest method is to use bluetooth, which means short range (as in the same room). I'm working on a similar application with the Gamekit framework. Look at the sample code on developer.apple.com for GKTank and GKRocket. These game demos are for two devices, but the framework will support what you need. In a bluetooth piconet you can have eight devices connected. Hope this helps you get started.

iPhone to iPhone communication

I have been looking into communication methods between two iPhone devices and as I understand it there are two main methods to do this: Bluetooth and WiFi. However I wanted to know if anyone knows of any other way of sharing information between two iPhones? If I were in an area with no WiFi or mobile signal, and couldn't use Bluetooth for whatever reason, is there anything that could be done to broadcast data from one iPhone to another?
I'm sure its a bit of a silly question, but if you don't ask, you don't get; and if someone knows of anything I might be able to look into with regards to this, I would be very appreciative.
Thanks,
Dan
AFAIK Wifi and Bluetooth are your only options for direct phone-to-phone communication.
Offcourse, there is still cellular data network because you are talking about the iPhone ;)