core-location

CoreMotionActivityManager returning either Automotive or Automotive + Stationary true

人走茶凉 提交于 2019-12-12 04:38:05
问题 I'm trying to detect Automotive ActivtyType, however the problem is if "I go on a drive and then stop the car and stay in the car" and simply check the coreMotion logs: I would continue to get numerous mixed callbacks of either high Confidence: Automotive: True, Stationary: True or high confidence: Automotive: True, Stationary: False or low confidence: Automotive: True, Stationary: True I do not get an only Stationary: True, it always comes with automotive being True as well There's not much

extracting nearest stores based on coordinates from xml file

怎甘沉沦 提交于 2019-12-12 04:14:00
问题 I am making store locator application. In my application i am showing nearest store to given latitude and longitude. i am getting my current lan. and lot. I have xml file on server containing all information of stores and latitude and longitude. What i am thinking to connect application with that xml file and gets nearest stores according to given coordinates. Now problem is how can i get nearest stores to given coordinates. I have heared about haversine formula but how can i use that formula

Wake app at regular intervals while using UIBackgroundModes=location

ⅰ亾dé卋堺 提交于 2019-12-12 03:22:52
问题 I'm developing a navigation app which uses the UIBackgroundModes=location setting and receives CLLocationManager updates via didUpdateToLocation . That works fine. The problem is that the intervals between location updates are very hard to predict and I need to make sure the app is called something like once every few seconds to do some other (tiny) amounts of work even if the location did not change significantly. Can I do that? Am I allowed to do that? And how can I do that? I found a blog

Get address from latitude and longitude in ios

邮差的信 提交于 2019-12-12 02:23:43
问题 I have been programming for ios and I need to get address. How can I get full address from latitude and longitude in json or other format? Can I get it without internet connection? Thank you for your attention. 回答1: What you need is the CLGeocoder (on iOS 5) and MKReverseGeocoder (on older iOS versions). Both use Google Maps to get address data so you need an internet connection to get data. You'll get address as NSDictionary , but you can easily convert it to a JSON string with JSONKit or

CLLocationManager stops in background

我们两清 提交于 2019-12-12 02:22:26
问题 I have an app which uses CLLocationManager to track the user's route, drawing dots along the path taken. The app runs in the background using Required background modes > App registers for location updates. As I understand, anything that happens in the background needs to be called from locationManager:didUpdateToLocation:fromLocation as this is the method that gets called with each location update. The problem I'm having is that sometimes this stops getting called. It seems to happen when the

didUpdateToLocation never called

柔情痞子 提交于 2019-12-12 02:13:02
问题 I am using both the simulator and my device to test this, but no matter what I do, didUpdateToLocation is never called. I have tried changing my location in the sim, turning off and then on again my location services on my phone to force the phone to search for a new location... nothing. In my viewDidLoad(), I have started the CLLocationManager as so: CLLocationManager *manager = [[CLLocationManager alloc] init]; if (![CLLocationManager locationServicesEnabled]) { UIAlertView

How to get gps Location with an iPod Touch (4th gen)

人走茶凉 提交于 2019-12-12 01:33:35
问题 I guess the answer has already been posted, but I am a lazzy boy :p . Seriously I am working on an iPhone Application which have to blit a map and use the current user gps location to locate the user on the map. The problem is that with iPhone (v1), and all iPod version there is no gps device, so is it possible to get the current gps location of the user (using google map api, with internet ... or something else) ? I would like to know the current gps user location without user gps device

MyApp “has active assertions beyond permitted time” crash - CoreLocationRegistration and CoreLocationBackgroundClient

旧巷老猫 提交于 2019-12-12 00:44:35
问题 Does anyone have any insight on why this crash log is happening? The app records the locations where the user goes. So it has the UIBackgroundModes's Location is set in Info.plist to continue getting location updates in background. According to the log, something seems to crash after 10 minutes. Incident Identifier: 4BA294E8-0DDF-4EC2-812A-20394F758A7F CrashReporter Key: 59997a4e160853691bc673802439c8c4b9ca7ba3 Hardware Model: iPhone3,1 Process: MyMapApp [1234] Path: /var/mobile/Applications

Can Get Location, but not heading

牧云@^-^@ 提交于 2019-12-11 17:27:59
问题 I'm only using the simulator currently, but I'm having trouble with CoreLocation in swift on the iOS simulator. I get position updates printed by this code, but never heading. I don't want course, I'm trying to make a compass type app that will show a bearing to a target. class CompassViewController: UIViewController, CLLocationManagerDelegate { var lm:CLLocationManager = CLLocationManager() override func viewDidLoad() { super.viewDidLoad() print ("view did load") lm.delegate = self; lm

Will Realm still be able to save the data while user has locked iPhone?

情到浓时终转凉″ 提交于 2019-12-11 16:57:30
问题 I am trying to save some data to Ream database while users have locked their iPhone. Thie data may be the location coordinate which produced by background location updates. If realm can't do it. Could Core Data do it? This is how I do it in code: - (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray<CLLocation *> *)locations { NSLog(@"didUpdateLocations: %@", locations); if (locations.count > 0) { CLLocation *location = locations.firstObject; if (location