determine location iphone - iphone

from what i read i understand that iPhone can determine your location using Wi-Fi. If you're not in range of any Wi-Fi, iPhone can determine your location using cellular towers.
I am currently develop app that use the GPS so my question is when there is no GPS signal (like in buildings)does the location services try automatic to determine the position through Wifi or cellular towers OR i need to do somthing manualy in the code??
if it does automatic does it return a GPS format(latitude, longtitude) or somthing else?
thanks so much.

It will return a position as always, but with reduced accuracy.

Related

Detect if Device has GPS

How to detect if GPS is available?
The iPod touch and iPad WiFi version don't have GPS, they have something else based on WiFi.
Anyway, how to know if GPS is available?
Or how to detect iPod Touch or iPad Wifi model?
This is a common difficulty on iOS... One way would be to get a location and check if the altitude is present.
if a valid altitude is present, the position has most probably been computed using GPS
else either the GPS has not picked-up any signal yet or it is not present.
Anyway on iOS Apple has a single interface for all location providers because they intend the developers to express their requirements in terms of accuracy, the control of the technology used should be left to the OS.
Not sure yet if my solution will cover every device... but... What I do is if it's an iPad ask if the device has a cellular connection (Know if iOS device has cellular data capabilities). If so, it will most likely also have GPS.
Not sure if this will cover every device correctly, but at least my test-devices are detected correctly.
To be 100% sure that it is a GPS loaction, check for attribute course. if this is valid then its from GPS. but when not moving course is invalid too.
you can use that condition as initial trigger that now you have GPS.
If you need an initial valid GPS when not moving, check for
vertical accuracy < 100 and horicontal < 50m

iPhone Cellular Triangulation For Current Location

I want to get the current location of iPhone from GPS and Cellular network. Is it possible to get the location from cellular network in iPhone. Please tell me any tutorial.
http://www.switchonthecode.com/tutorials/getting-your-location-in-an-iphone-application
The iPhone uses wifi access points, cellular towers and gps depending on what's available and provides the information more quickly. This all happens in the background using the Core Location framework which the tutorial above covers.

iPhone Development - Assisted GPS

What's the deal with iPhone's GPS? I never get a good reading when i'm in my office building, or in my room. What really ticks it! and what doesn't? Please help me understand the assisted GPS science.
If I'm not mistaken, the gps tries to pinpoint your position using three methods:
1. Satellite
2. Mobile network
3. Wi-fi networks
So if you don't have a good reading, then probably one or more of these methods cannot be used properly in your area. For instance, satellite will not always work that well in buildings with thick walls and ceilings.
Assisted GPS means that it may have it's location from different sources than GPS satellites, for instance known wifi hotspots, or GSM masts. However these sources are less accurate the true GPS.
Claus
For the actual GPS in your iphone to get a good position, it has to be in direct sight of the GPS satellites. It cannot do that inside a building. So if you are inside you are not going to get the best position from the iphone. It can give you a position using other methods such as the cell phone network and public wi-fi networks, but these positions aren't as accurate as the real GPS position.
Here is an article that explains the GPS system:
http://en.wikipedia.org/wiki/Gps
Depends on whose definition of Assisted GPS.
True 'assisted GPS' means the GPS receiver uses a known initial position, from the cell tower location, to bootstrap the GPS position calculations. If you know where you are it's much quicker for the position solution to lock to the signal - that's why GPS take so long to find first fix compared to updating.
Some APIs use assisted GPS as shorthand for alternate location services where if GPS is not available, is disabled, or would use too much battery power it will supply a lower grade position based on cell tower triangulation or other methods.
There are many answers I found in WWDC 2010 – Session 115 - Using Core Location in iOS 4.
Very advised.

What differences are there between Core Location on the iPod Touch and iPhone?

I guess the GPS chip is only there on the iPhone. But for some reason, my iPod Touch seems to know my position anyways even without GPS chip. So what does that mean for Core Location? What do I have to consider when using Core Location both on the iPhone and iPod Touch? What are the differences?
I believe the API is the same. All that differs is the accuracy of the location that gets returned to you via the API.
the iPhone uses the GPS to get a pretty accurate lock on your location, whereas the iPod Touch uses IP-Location or Wifi-Triangulation technology, which is less accurate than the iPhone's GPS.
The iPod touch uses this method for Core Location information
http://en.wikipedia.org/wiki/Skyhook_Wireless
-t
The iPhone uses a technology called A-GPS (the A stands for "assisted"), whereby the the cellular network and WiFi networks assist the GPS chip in determining your location. Depending on your location, this might result in a more accurate triangulation of your position.
While the iPod touch can't use GPS satellites or cellular towers to determine your location, it can use WiFi, so thats how your iPod touch knows where you are.
As far as the CoreLocation APIs go, there shouldn't be a difference between the devices, however accuracy will probably be lower and less consistent on the iPod Touch.

How accurate is the triangulated GPS of the non-3G iPhone?

Does anyone have any experience with the triangulated GPS used by the non-3G iPhone? How does it compare with 3G positioning? Does the iPhone 3G use triangulation in the event that there is no GPS signal available? Is there anyway to determine the accuracy of the non 3G coordinates? Thanks.
I have done a lot of mobile software with a bunch of different devices including 3G iphones and 3G blackberry's and here is what I have found.
The blackberry and iPhone GPS is really good when you have clear line of sight and at least 9 satellites present. In some dense residential or urban areas you might only get 5-6 satellites which can take a while to converge.
If you do not have a signal, GSM phones like the iPhone will try and find your position using cell tower signal strength but it is NOT as accurate as GPS... not by a long shot.
I have heard, though this has not been confirmed that the iPhone also uses some server side machine learning when it can't find a GPS lock meaning that it takes the average all of the cell towers, plus the average of all the users who have used GPS in your area to try and find your best position. This is sometimes called AGPS or assisted GPS where the GPS information and cell tower strength are used together.
Also, the only thing I can think of for finding the accuracy of the non 3G coordinates would be to programmaticly switch providers in your code, or simply go into preferences and turn off 3G and write an application that does some tests.
The Pragmatic Programmers have a great iPhone SDK book that just added a chapter on using the Location API, so that might be a great place to start.
Hope this helps.
The CLLocation class has the properties 'horizontalAccuracy' (for latitude/longitude) and 'verticalAccuracy' (for elevation).
In addition to cell towers and GPS, locations may also determined by Skyhook Wireless, which has a database of Wi-Fi base station MAC addresses and locations.
When using only GSM towers, it's +/- 500m (it varies greatly, sometimes it's more precise).
If it finds known Wi-Fi network, then it's down to +/- 50m.