Apple's new M7 co-processor is said to enable a new generation of health and fitness apps by providing continuous monitoring of movement without draining the battery.
At the iPhone 5S announcement, Apple listed support for these sensors:
Accelerometer
Gyroscope
Compass
It doesn't mention GPS hardware, but because it would make sense for me, I'd like to know if the M7 processor can also be used for low-power geo-location tracking?
The low power option is to specify that the location manager can use deferred updates. When you do this the GPS hardware (where supported) will maintain a cache of updates until it's buffer is full (or your specified max distance is exceeded) and then send a block of updates to your app in one set (saving power by not activating the app frequently).
M7 Coprocessor would not be helpful in anyway to track the location. But some apps like STRAVA run is using M7 data to monitor the motion activity and start the GPS when the motion is detected. Which is great to save the battery.
Related
Is there any way to detect that an external GPS unit is connected to an iOS device (say running iOS 13)?
We're building a special-purpose app that really needs an external GPS to work well, and want to warn the user about accuracy issues if only the internal GPS is available.
(Of course, we could wait until inaccuracies occur, but by that time it's sort of too late.)
the only way I've been able to do it is to compute position updates per second. the internal gps is 1hz. The external gps that I connect to (garmin glo) is 10hz.
If anyone has a better solution I would like to know.
I am developing an iOS (7.0+) application for fitness (running) that uses the users GPS location, does a small calculation and transmits the data to a Bluetooth Low Energy (4.0) watch. This process needs to be happening in the background, even when the user locks their iOS device.
I have implemented the following background modes as well:
App communicates using CoreBluetooth
App registers for location updates
I have successfully been able to get everything to work well, except for after a certain amount of time (ex. 2 hours) when the device is locked, the iOS device stops updating the location because I can see that it is no longer sending updating GPS values to the Bluetooth watch. I then have to unlock the device, re-open the app and location services works as it should again.
Does anybody know how to keep location services running the whole time in the background (device locked) without it suddenly stopping the location updates after a certain amount of time? If possible, an efficient solution would be preferred that does not drain the battery too much more than it normal would for using GPS.
Most important: make sure you are setting pausesLocationUpdatesAutomatically to NO before you start the CLLocationManager (see docs).
To minimize battery usage you should also use deferred location updates (more details on SO). This allows the CPU to sleep and save battery while the GPS chip collects location updates for you. It periodically dumps them to the CPU. This may not be for you if you need to update the watch once a second, but if you can update it every 10 or 20 or 30 seconds it will save that many CPU wake ups.
I am working on a project where I first wanted to advertise a device as an iBeacon and make it possible to connect to that device via Core Bluetooth at the same time. Besides the fact that this is not easily doable (a device cannot advertise as an iBeacon and CB device at the same time), I noticed that the iBeacon part seems unnecessary - discovering peripherals with Core Bluetooth seems to be basically the same as discovering iBeacons.
My first Question: Am I right in assuming this? Or does iBeacon provide anything that central/peripherals in CB do not? Especially in regard to background advertisement/searching?
The only issue I can see right now is that the CLBeacon gives me both an rssi and an accuracy (and from this, the approximated proximity is calculated). With Core Bluetooth, centralManager:didDiscoverPeripheral:advertisementData:RSSI: gives me only an RSSI. Is there any way to retrieve the accuracy here so I can calculate a proximity? This is important for me and I guess relying on RSSI only for the proximity will give me less accurate results?
My second Question: Can I get the accuracy that I get with iBeacon in Core Bluetooth or a similar measure to calculate the proximity?
You can calculate your own distance estimate with RSSI using an algorithm like the one I posted here:
https://stackoverflow.com/a/20434019/1461050
The trick is that you will need as many RSSI measurements as possible averaged over a time window of 20 seconds or so to reduce the noise on the estimate.
The main advantages of using CoreLocation APIs to detect standard iBeacons vs. using CoreBluetooth to detect custom beacons are:
A variety of cheap off-the shelf hardware is available for the iBeacon standard.
CoreLocation can scan for iBeacons in the background (likely using hardware assist on iPhone 5+) in a way that can automatically launch your app relatively quickly, even if the user did not manually launch it since boot. As of iOS 7.1, even if the user kills the app from the task switcher, CoreLocation can re-launch it into the background if an iBeacon is detected. I do not believe all this is possible with CoreBluetooth.
The iBeacon transmission allows you to easily read the UUID/major/minor identifier combination in iOS without pairing. This 20 bytes of data (with the major and minor fields able to be set to arbitrary values) is more than you can get from a 16 byte Bluetooth Service UUID.
You don't have to roll your own software for distance estimation.
Is it possible to actually determine with any degree of certainty whether an iPAD actually has a GPS signal. I can think of three cases
Wifi-Only IPAD
Wifi-Only IPAD with External GPS (such as the DualXGPS)
Cellular IPAD with Internal GPS
Apple documentation mentions:
Some location services require the presence of specific hardware on
the given device. For example, heading information is available only
for devices that contain a hardware compass. This class defines
several methods that you can use to determine which services are
currently available.
Are there specific calls that work specifically with a GPS only such as heading or tracking? I'm assuming perhaps only GPS devices have a heading call because the documentation says:
In iOS, a device with the appropriate hardware may also report heading
information. When the value in the headingAvailable property is YES,
you can use a location manager object to retrieve heading information.
Some previous posts suggested trying to get a lock on a very accurate GPS update
Detect if Device has GPS
How can I tell if an iOS device has a GPS?
but i was hoping for something a little more concrete these methods "feel" wishy-washy - because just because an inaccurate GPS signal would likely look like there is no GPS when the device actually has the capability. Also I would think a wifi device which can "mimic-gps" might also some how pass one of these conditions.
Thanks for any help!
The simplest answer is that you should try to use the GPS at the accuracy you need and see if you get it. And deal with the fact that you might not get this accuracy because the user is in a building, or an urban canyon, or doesn't have GPS hardware, or has turned off location services (although this can be detected).
If you get better than 100m accuracy or if the CLLocation has altitude you almost certainly have GPS hardware (but you have to wait quite some time to get a signal lock on at least 4 satellites to get altitude). If you have a cellular radio connection (see Reachability) then you have GPS hardware (except iPhone1). If you have digital compass capability then you have GPS hardware (except iPhone 3G).
Internal GPS hardware is available on all iPhone and iPad that have cellular radios (except iPhone 1, see wiki chart). If you study that chart it appears that all devices (so far) that have GPS hardware also have digital compass (magnetometer) except iPhone 3G.
Using course (as suggested here) from the CLLocation only works if the device is moving fast enough and the GPS has satellite lock. A better option would be to detect if you have a heading from the compass (magnetometer).
You can use the hardware string to determine device capabilities by hardcoding a table of what hardware has what capabilities (described here). This has to be kept updated (which means an app update) when new devices are introduced. Erica Sadun has categories for UIDevice called Capabilities and Hardware on github that attempts this, but may not be usable in the app store.
None of this will help with external plug-in GPS or external bluetooth GPS devices.
if (location.getHoricontalAccuracy()< 40) {
// for sure GPS
} else {
// no GPS or unusable bad GPS
}
you can also use speed and course, if they are valid, then they are from GPS, because It is the only sensor that can measure speed and course. (magentometer shows the current heading, which works without GPS)
i am looking for a gps tracker using bluetooth low energy (so there's no need for mfi-programm. using apple devices).
Is it even possible, since BTLE saves energy and gps-tracking requires a more or less constant connection?
I'm thankful for any informations I can get about BTLE + GPS
Greetings
Timm
I know no equivalent on iOS platform - but on Android platform - use SmartNAVI to broadcast mock GPS location using the phone sensors (starting from a know location) as a replacement GPS (so GPS does not need to be on) - then feed this into an app called BlueScan - which logs BTLE device RSSI based on there GPS location and time. - I wish there were something equivalent on iOS - but alas iOS is seriously behind in the world of engineering development/IT platform when it comes to the world of IoT, BTLE, etc.