Currently I'm doing an location app in iPhone but my question is....
What is the service does iPhone using?
According to Apple Developer Manual
"The framework uses information obtained from the built-in cellular, Wi-Fi, or GPS hardware to triangulate a location fix for the device."
So it will be either built-in cellular, WiFi or GPS hardware, how am I ensure that it always uses GPS hardware to get the location?
Because my app requires accurate location.
To limit the supported devices to the ones with GPS you can use the UIRequiredDeviceCapabilities in your app's plist. The only way (to my knowledge) to force the device using the most precise location determination (in this case GPS) is to set the desiredAccuracy and distanceFilter of CLLocationManager accordingly.
Related
I know how can I fetch current location but I want does ios support different api for mobile network and wifi network for getting of current location or same api will use for both?
Does ios current location api will take care of both network connection?
Reference from
https://developer.apple.com/library/ios/DOCUMENTATION/CoreLocation/Reference/CLLocationManager_Class/CLLocationManager/CLLocationManager.html#//apple_ref/occ/cl/CLLocationManager
No, there is a single API for this case. What hardware the device uses is abstracted away for you. The desiredAccuracy property may however influence what hardware is used. If you request a kCLLocationAccuracyBestForNavigation accuracy it will most likely use the GPS hardware which is more expensive on battery. However if you request a kCLLocationAccuracyKilometer accuracy it will likely use cell tower information and triangulation strategies, but may consult the GPS hardware occasionally. You really should not need to worry about this when using the Core Location framework.
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
specifically this question is for iPhone only, basically the question is - does iOS location service still give the geo-location (lat, long) when the device has no carrier service neither wifi connection?
Yes it will give you the location using GPS and if the GPS signal is not there it still gives you the old cached location. So in any case it will give you the location.
So far as I know, the latest models (since 3? I think?) have an actual GPS so as long as you can "see" open sky it will be getting lat/long. Whether or not the related apps are able to function (whether it can load the maps, for instance) is another matter entirely.
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.
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.