Significant-Change Location Service will use Wi-Fi or Mobile Data? - ios

When use Significant-Change Location Service it must use Wi-fi ? Without Wi-fi this service will work or not?

Theoretically it should work but location mechanism is a bit complicated in iOS.
iOS devices uses a system called aGPS. Which relies on combination of gps, cellular, wi-fi, geofencing etc. Wi-fi is the fastest location update option for the location manager since you can get your accurate-enough information immediately. GPS is the most accurate one but it takes couple of minutes to lock and determine your location if you changed your location a lot since the last lock on.
So maybe you had an impression that when wi-fi is disabled significant change location service doesn't work but actually it does. At least this is the expected behavior.

Related

How to get location by GPS without network in iOS?

I use CoreLocation Framework to get location, when in network it work normal , but when without the network, it can not locate always. it will not stop receiving location information after seconds. I want to know how to use GPS locating without network?
I think you are using your device in a house or building, where the device can't receive GPS satellite signal.
If that's the case, what you are seeing is the expected results. iOS internally keeps the last location (cache). When you start location updates, iOS passes that cashed location quickly to locationManager(:didUpdateLocations). When no network nor satellite signal, no location update will be sent thereafter.
If your device is receiving wifi w/o satellite signal, iOS determines the rough location by using the wifi, and sends location updates. You can't distinguish the source of location updates; they could be from wifi or from GPS satellite. (actually, you can guess by seeing the accuracy. when the source was wifi, accuracy was fixed to 50m w/ my iphone.)
One way to check if your location update is cached or not is to check the time stamp of location update.
The cashed location update should have older time stamp than when you started location update.
So, to your question, you are doing just right thing. Location manager is very easy to use. Try to receive satellite signal in open sky w/o network. For your tests, don't move. It may take 5-7 minutes at most. If you move, it may take longer. Hope this helps.

Significant location change doesn't work on Wifi only devices

Correct me if I'm wrong, I have two devices (iPhone), one with sim-card included and wifi connected, other doesn't have an active sim-card but connects to wifi. I was on train to test the significant location change on both devices, only the one with sim-card sent significant location change event. The one without sim-card didn't fire any event even though it still connected to Wifi.
Any link references are appreciated. IMO, does the significant location change only work with cellular data ?
I believe the significant location change updates location only when the phone swap from a cellular tower to another, so if it is not on the cellular network (without sim card) it can not detect that, and therefore cannot provide a position :)
From Apple doc:
The significant location change service is better suited for apps that want to get the user’s initial location and then only want to know when that location changes. This service requires the presence of cellular hardware and delivers events less frequently than the standard location services.
Source

In ios, is it possible to know if the GPS location is not being updated?

I'm creating an app that allows the user to navigate with a map when offline (no internet connection or wifi available), and I want to let the user know if the gps location not being updated. I know I can get the last updated location timestamp and the accuracy, but is it possible to know if the gps has no reception?
No, there's no public interface for finding out about the state of specific location hardware such as the GPS receiver.
The Location Manager abstracts all that away, so that developers can get location and accuracy information without worrying about whether the device used GPS, Wifi, iBeacons, cell tower locations, Loran-C, celestial navigation, etc. to determine the location. This is generally a very good thing because it means that your apps work on all devices regardless of whether they have GPS, and will continue to work (and maybe even work better) on new devices that might use other technology. But it also means that you don't get to ask the question "is the device receiving a GPS signal right now?"
Is it possible to know if the GPS location is not being updated?
No. It doesn't seem possible given the available API.
There are a few things about GPS to consider, if you haven't already. It is technically possible to receive a location update from CLLocationManager when you're "offline" but it will depend on several things:
If your device actually has GPS hardware. Some don't.
If you have line of sight to GPS satellites. There's a difference between GPS and A-GPS
Those true GPS updates will come much less frequently because of the way GPS works, but it should work.
... but is it possible to know if the gps has no reception
Based on the way GPS works (as best I understand it) you either turn the radio on/off (-startUpdatingLocation/-stopUpdatingLocation) with the Location Services API and you either get locations more frequently with A-GPS or infrequently with pure GPS when you don't have a network signal. I don't think the Location Services API has a way of telling you "I don't have a GPS signal at all."

How to get the location provider name in iOS?

In Android whenever you get location object you could call "location.getProvider" on the instance to get value like "wifi". Is there something similar in iOS (CLLocation)?
The Location Awareness Programming Guide says:
The [CoreLocation] framework uses information obtained from the built-in cellular, Wi-Fi, or GPS hardware to triangulate a location fix for the device. It reports that location to your code and, depending on how you configure the service, also provides periodic updates as it receives new or improved data
Having said that, you do not have access to how precisely the CLLocationManager determined your location (other than, if you used significant change, that it probably used cell towers). You theoretically could use Reachability to see if you have Wi-Fi availability, but you have no assurances as to what mix of GPS, cellular, and Wi-Fi it used to get your location (even if you happen to have WiFi connection).
What you do have is horizontalAccuracy, which tells you approximately how accurate the location you received is. From a user's perspective, that's probably a more important piece of information.
There isn't a concept of what system provided you with the location on iOS. What you can do is check what the accuracy of the location is. Based on how precise the location is, you can probably surmise if the location was provided by a GPS signal.
The reason this isn't given is that iOS will provide you with an initial location which won't be very accurate (likely based on geo-ip or cell triangulation) and then update the location with more and more precise coordinates if GPS is available.
If your application requires the accuracy provided by a GPS chip, you can add UIRequiredDeviceCapabilities = gps to your Info.plist.

Is it possible to get GPS information in a mobile device through APIs without having any GPRS connectivity?

Is it possible to get GPS information in a mobile device through APIs without having any GPRS connectivity?
Edited
Yes, for example on the Java ME platform or Apple iPhone
Yes; if you are on a device that has GPS hardware in it and software development on the device gives you access to that hardware from your software.
This can be using a built in API for opening a COM port. You then just need to open the port that has the GPS hardware connected to (internal GPS receivers inside the device are often connected to a fixed COM port number) start interpreting the (often) NMEA strings that the GPS receiver is sending out.
Or perhaps the device has more specific GPS related APIs, like the GPS intermediate driver in Windows Mobile 5+ that lets the OS talk to any GPS receiver (either built in, or connected via cable or bluetooth to a COM port) and lets multiple applications concurrently interact with the GPS data.
P.S.
GPS has nothing to do with GPRS per se. You might have gotten that idea because of A-GPS which uses telecom network information and/or a dataconnection (like GPRS, EDGE, UMTS, WLAN, whatever) to download a small file with information about the location of GPS satellites.
This data will then enable your device shorter GPS aquisition times within the time period that this retrieved data is current - often a couple of days to a week I believe - because it does not just need to see what GPS signals it can receive and make sense of that, but it has a lot of prior knowledge about the GPS constellation that should be in orbit in the part of the sky you can see.
GPRS is a two-way data transmission which enables you to access the iternet while the GPS is just a receiver and as peSHIr already mentioned it has nothing to do with GPRS. GPS receiver receives the signals from multiple satellites and calculates the location from time differences.
Anyway... you need GPRS or any other internet connection only if you want to use any web service for reverse geolocation or you want to use google maps or any other location service. But just for receiving (calculating) the coordinates GPS by itself is enough.

Resources