Use only GPS for iOS device location - ios

I need to know if the GPS device component of my users is healthy, so i want to get the location ONLY by the GPS and NOT form wifi or surrounding antennas.
I'm forcing my users to close their wifi before this operation so i definitely know that the received signal is not from the wifi (because its possible).
I tried to work with the CLLocationManager and CLLocation's horizontalAccuracy.
some people say that when the horizontalAccuracy is lower than 160 it means we have a good GPS strength, but its not perfect at all..
I also tried to create an array of [CLLocation] after calling [locationManager startUpdatingLocation], and than i saw that when i'm in a place like a basement(with no GPS signal), my array's count was lower that a situation with signal because the updates frequency is lower.. but this is not a perfect solution either..
I just want to be sure that the GPS component is definitely working and the location that i get is from the GPS.
so, any solution please?

Related

iOS Swift Getting Approximate Location Indoors with CLLocationManager

For an app I am making I track the users location on a map. When outdoors, I am able to get the coordinates of the users position almost instantly and the app works great. Indoors, as expected, does not have GPS signal so I cannot get the location. That said, iOS uses Wifi and various other techniques to show my approximate location on a MapView still. However, I am unable to get the approximate coordinate while indoors even though iOS knows it (ie. didUpdateLocations is never called while indoors but is the second I walk out the door). I'm wondering if there is a way to get an approximate coordinate while indoors (I don't need exact).

How I can get gps signal on my iPhone indoor?

I developed an app which calculates distances between current position(lat and long) and another stores location. Current position comes from built-in Gps on iPhone. In some buildings is working indoor( like 8meters far from windows or doors). Why is it working indoor? How can I still get GPS signal without WiFi/3G/4G connection?
i hope someone can answer me
Welcome to SO.
The short answer is, it's out of your control. GPS is not reliable indoors. Sometimes you are able to get a signal, sometimes not. Metal frame buildings are worse than wood-frame buildings, and brick also tends to interfere with GPS signals. Florescent lights also tend to interfere.
In a given indoor setting you'll either get a GPS signal or not.

How can i know the latitude(X) and longitude(Y) position of iBeacons

I want to know the position of the iBeacons when the user its near by. i am using the estimote device.
i am able to get the distance within the iBeacons. but How to calculate the position. Please check the below image.
This is the screenshot from the estimote application.
Note : i have put my iBeacon device to the estiomote application. they
detect the movement of the iBeacons. so how they do it?
This is Wojtek Borowicz, I'm a community evangelist at Estimote.
The beacons do not broadcast their position with X and Y values. They only transmit their ID, sensor data, and information about signal power, based on which the proximity is calculated. The only way to include long/lat and associate it with beacons in your app is to either hardocde their location into the app or fetch it from a database in the cloud.
The radar sceen in the Estimote mobile app doesn't show the location of the beacon. The app does not determine the direction from which the signal is coming, only the proximity. The visual representation is simply an UI thing, to help visualize the idea behind this technology.
Cheers.
You can't. That was never a design goal of iBeacon. You know that the device is near the beacon, that's all you should need to know. To get your location, use CLLocation.
Knowing the position of beacons, one and only one solution => having the position of each beacon in a database and querying it...
Beacons are dumb, they only know who they are, never where they are.
Update
Blockquote Note : i have put my iBeacon device to the estiomote application. they detect the movement of the iBeacons. so how they do it?
Estimote beacons have accelerometer and temperature sensose
http://blog.estimote.com/post/81380655308/estimote-sdk-updated-with-accelerometer-and-temperature
iBeacons don't work that way - you can get an estimated distance, but the signal is non-directional, so there is no way of knowing which direction the iBeacon is in.
You can maintain a database of the latitude and longitude where each iBeacon is installed (using the major/minor to identify the beacon in your database) but that won't tell you precisely where the phone is in relation to the beacon

ibeacon powered on as opposed to enter or leaving region

I have been playing around with various test apps that detect when the device enters or leaves the iBeacon's region but my question is are there any apps that will detect when a beacon is turned on?
The reason I ask is that if I sit in the same room as my iPhone and remove the battery from the beacon then re-insert it the none of the apps that I have tried so far trigger a region entered response.
Please excuse my non tech question as until I can find out if this type of detection is possible I haven't yet fully immersed myself in the coding as it may not be suitable for my application.
Think about it from your phone's perspective: Powering down an iBeacon looks exactly the same as moving out of its transmitter range. Likewise powering up an iBeacon looks exactly the same as entering its transmitter range.
The way that the iOS CoreLocation monitoring callbacks work (didEnterRegion / didExitRegion) is exactly the same for the two cases above.
I suspect the reason you aren't seeing a didEnterRegion callback when you power on your iBeacon is because you didn't leave it unpowered long enough. It takes time for iOS CoreLocation to decide the phone exited a region, and it generally won't tell you that you entered a region if it thinks it never left it.
Two suggestions to make this easier for you.
When doing testing like this, always verify you get a didExitRegion indication before expecting a didEnterRegion event. (Add NSLog lines to your appDelegate to help you see this.)
Turn on ranging for iBeacons whenever you set up monitoring for iBeacons. This makes the time needed to detect region transitions much faster when you are in the foreground.
More information on the time it takes to detect region transitions can be found in this blog post.
I had similar experiences and assume the phone checks for new beacon only when you move around. That makes sense from an energy saving perspective and the main use case of beacons.
To detect a beacon when it's powered on is possible, if the CLLocationManager object is currently ranging for the beacon, and it's already in range.
The thing to understand here is the difference between region monitoring and beacon ranging.
Some apps only start with region monitoring, ranging only when a region is entered, and stop ranging when the region is exited.(taking the batteries out will cause the region to be exited) When you put the batteries back in, the beacon in this case is not detected because ranging has been stopped.
When your app launches start ranging with startRangingBeaconsInRegion: method and don't stop this anywhere in your code.

why did didupdatelocation be called when device is not moved

i use CLLocation for a app that record people's trace in map view when they are running or walking ,but i found when my device is still (not moved) ,the
- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations is also get called frequently ?
currently ,my locationmanager's desiredAccuracy is 10 meters and distanceFilter is 10.
how to deal with this situation? I have tried use big distancefilter value(like 150) ,but I found if i do this, then i can't record exactly when people is running or walking
GPS is not exact. You can move around a few feet and get the same location. Or you can sit still and get told you have moved a few feet.
You might be able to combine measurements from the accelerometer to determine if you have really moved but this would only work if the device was sitting on a table not moving.
Have you called stopUpdatingLocation after the initial startUpdatingLocation? It will keep updating location if you do not call it.
How does system know whether or not you have actually moved? It MUST fetch your location to find out. The more accurate your desired accuracy is, the more vigorously and frequently it would look. By vigorous I mean if it's suppose to use cell-tower information then it would look into more cell-towers to better triangulate. Or simply put it, the interval between its fetches would be smaller. Concluding: OS would fetch data even if you don't move.
Additionally to triangulate your position the OS (depending on your desiredAccuracy and previous movements) would use a mix of GPS, wifi, Cell-tower. And because someone may all of sudden turn off/on their wifi, or satellite that you were using to get your location has moved a bit or the satellites have changed, or a cell-tower signal may become more or less accurate due to its bandwidth limitations then your calculated location may change which triggers a callback if it's more than your distanceFilter. ( I don't believe you get callbacks for less than your distanceFilter, but I may be wrong) This likely means your distanceFilter is set to very small number which depending on your business requirements may or may not be a good choice. Concluding: your location is never ever 100% accurate
The result of periodical fetching, possibility of error and small distanceFilters lead to possible incorrect locationChanges.

Resources