iPhone GPS tracking through Gamekit/Bonjour - iphone

I'm familiar with CoreLocation, however, I need to design an application that shares the user's location across a shared network for business purposes. I wanted to know what would be the best way to transmit the user's Map Annotation to other devices on the shared network? Is GameKit/Bonjour the best place to start? Thank you for your help! ^_^

I'm afraid you did not provide enough information about your application needs. Anyway, you should read corresponding guides to have an idea about their limitations.
GameKit
http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/GameKit_Guide/GameKitConcepts/GameKitConcepts.html%23//apple_ref/doc/uid/TP40008304-CH100-SW18
There are some limitations:
GameKit is not available for Mac OS X (if you need it too)
There's maximum number of peers (client-server game is limited to 16 players)
Bonjour
FAQ - http://developer.apple.com/networking/bonjour/faq.html
Basically - Bonjour is here to help you identify services on your network. In other words, Bonjour can help you to find other devices with your application on the network, but it doesn't implement data transfer for you. You have to implement it on your own.

Related

Bluetooth LE Profile for reading measured data

I read a lot about Bluetooth LE in the past hours, but I do not really understand how profiles work. I want to pair an iPhone with a self-made device over BTLE.
The device should send measured temperature values, humidity or other values over Bluetooth and the iPhone should read that data.
I read about different profiles in the BTLE specs (even about heart measurement), but how does one proceed, when reading CO-emission for example?
Thanks a lot!
Regards, mary
There are two sides to this: the profile you'll define on your device and the code you'll write to communicate with this profile in your iOS application.
On the device, you'll define a profile with specific services for the measurements you want to gather. There are several standard Bluetooth LE profiles which you can find in a list on the main Bluetooth developer site. These include profiles for temperature, heart rate, and walking cadence, among others, so if you are providing measurements in one of these categories you can make your device provide one of those services and it will be usable with any iOS application that reads from that service.
For values that aren't covered by one of the existing services, such as the humidity readings you mention, you'll need to create your own custom service. You'll just have to define the service characteristics (what type of data you'll provide and how you'll provide it) and give this service a unique identifier, because it's one you're creating and not part of the standard ones laid out by the Bluetooth organization.
How you define these services and characteristics will depend on the specific Bluetooth LE hardware you use for your device. I've done most of my work recently on Bluegiga's BLE112 chip, which combines a low-power microcontroller with a Bluetooth LE transmitter. They have very good tools for defining device profiles and creating matching firmware, and it's reasonably straightforward to set this up on their chips. I can't speak for other manufacturers, but they most likely have something similar.
Once you have a profile defined on your hardware, you'll need to look for devices advertising it and be able to connect to them within your iOS application. You'll use Core Bluetooth for this, and I highly recommend starting with one of Apple's sample applications, such as their Temperature Sensor example. That example uses the standard health thermometer profile, but you can tweak it to find your proprietary services in addition to the temperature readings. You can see how they read and process the binary data returned from the LE device in that example.
I highly recommend watching Apple's two WWDC 2012 session videos on the topic, Session 703 - Core Bluetooth 101 and Session 705 - Advanced Core Bluetooth, because they provide a lot of background on the topic and show practical examples of this in use.

Using the new MonoTouch.CoreBluetooth namespace

I have found a few samples on how to use GameKit for bluetooth communication and even accessing bluetooth functionality using native code but no example on how to use the MonoTouch.CoreBluetooth namespace.
Seems a shame using hacks when the full implementation is just waiting to be used.
Can anyone please share a sample or source (a link to a book would work as well) for the new MonoTouch.CoreBluetooth.
CoreBluetooth is just for communicating with devices that utilise the Bluetooth Low Energy Profile, such as watches, heart rate monitors etc.. It is not possible to use any other profiles with CoreBluetooth, so not possible to connect to another phone, a computer etc...
(Although given the name, I hope in future apple will provide lower level access to bluetooth comms in this framework)

measure network traffic separately

i want to measure network traffic of
GPS , 3G and WiFi separately
Application vise separately
in iphone , can any one suggest me the APIs to perform all above task or show me some example or road map.
There's no way to get those figures from the publicly documented APIs (and I don't quite know what you mean by 'network traffic of GPS', because GPS isn't a network protocol). So the answer to your question is: no, nobody can suggest it, because it's not possible within the public APIs.
You can probably do it using undocumented classes or on jailbroken devices, but if you're looking to put your app on the app store there's no point considering that because it will just get rejected.

iPhone best method to achieve device-to-device communication

What would be the best method to achieve realtime device to device communication within an application? I've been experimenting with the Apple Push Notification Service but find it spotty at best for realtime messaging. Is there a way to utilize sockets for this or am I just stuck into using the APNS?
If you are a beginner, use GameKit.
When you get sick of that, use AsyncSocket.
GameKit is so simple a child can use it; AsyncSocket is probably the most beautiful library in all of networking on any platforms - incredibly easy to use.
In both cases, you will first use Bonjour (two lines of code) to "find" the other device.
Here is the full explanation...
Tablet(iPad/Android)-Server Communication Protocol
Critical secret knowledge about GK you will need...
Client/Server GKSessions
Another quick summary ...
Most effective way to do networking on Mac/iPhone?
For the record, APNS has absolutely nothing whatsoever to do with what you are trying to achieve! Utterly forget about APNS.
WHAT IS THE RADIUS? -----------------------***
Please note that BLUETOOTH ONLY WORKS over about twenty feet. (Ten meters.)
Please note that for a local WiFi connection, you must both be connected to the same local WiFi hub. WiFi hubs have a range of perhaps 20 meters only, say one house and the next house only (depending on how thick the walls are).
Please note that: IT IS NOT PHYSICALLY POSSIBLE TO CONNECT TWO COMPUTERS (OF ANY TYPE) OVER A COUPLE OF MILES.
There is no such networking device. (You could perhaps build one using say "ham radio" but to be clear it would be a completely novel, new research project that would take a large company years to complete.)
There is absolutely nothing that works like that - I'm sorry to tell you the bad news.
The ONLY two possibilties are Bluetooth and WiFi, and they work only over about 20 and 30 feet respectively.
So how do you connect two remote computers like that? The answer is, via the internet.
The only way to do it is with an internet connection. There is no 'direct' connection possible with any existing technology.
If you need to know more about how to connect two computers (say two iPhones) using the internet, you will probably have to ask a new question! You will be pleased to know it is very easy and will cause you little trouble.
Note that both iPhones MUST have a good solid internet connection. If they are more than say 30 feet away from each other, the ONLY way to connect to iPhones is via the internet. THey must each have a good internet connection, or there is no possibility.
I hope this helps clarify things!
You can use GameKit's peer to peer services (bluetooth)
Gamekit how to do p2p wifi connection in iphone
Check out Apples GameKit framework GameKit Or a sockets based networking look at AsyncSocket which also includes an iPhone demo.

Finding the systems connected in local network from iPhone?

I am developing an application which identifies(find) all the systems connected in same network/LAN to share the data.
could please share with me how to identify(find) the systems which are connected in same network/LAN.
thanks in advance.
When you say all systems, I assume you mean all instances of your application? If so then the correct solution is to use Bonjour. Documentation on how to use it can be found here. Note that your app needs to be actively running on all the devices that you are trying to discover, since the iPhone does not support background apps.
If you are just talking about finding all other devices in the area then you need to resort to techniques like port scanning.