public LocationManager() { this.locMgr = new CLLocationManager(); this.locMgr.PausesLocationUpdatesAutomatically = false; // iOS 8 has additional permissions requirements if (UIDevice.CurrentDevice.CheckSystemVersion(8, 0)) { locMgr.RequestAlwaysAuthorization(); // works in background //locMgr.RequestWhenInUseAuthorization (); // only in foreground } if (UIDevice.CurrentDevice.CheckSystemVersion(9, 0)) { locMgr.AllowsBackgroundLocationUpdates = true; } _lastLocation = new LocationTracker(); _watchTowerSettings = SingletonManager.WatchTowerSettings; _bgWorkerWrapper = new BackgroundWorkerWrapper(new DelegateDefinitions.DoWorkOrWorkCompletedDelegate(PostLocation), new DelegateDefinitions.DoWorkOrWorkCompletedDelegate(PostLocationCompleted), _watchTowerSettings.UpdateInterval); StartLocationUpdates(); }
public override void ViewDidLoad() { base.ViewDidLoad(); _watchTowerSettings = SingletonManager.WatchTowerSettings; _locationManager = SingletonManager.LocationManager; _mapIconManager = SingletonManager.MapIconManager; // create map sub-view and add to main view CameraPosition camera = CameraPosition.FromCamera(latitude: 0, longitude: 0, zoom: 1); mapView = MapView.FromCamera(new CGRect(0, 0, View.Frame.Width, View.Frame.Height - 49), camera); mapView.MapType = GetMapType(); mapView.Settings.MyLocationButton = true; mapView.MyLocationEnabled = true; View.AddSubview(mapView); // now initialize report location button and add to main view InitializeReportLocationButton(); View.AddSubview(_reportLocationButton); // set up background worker SetUpAndStartBackgroundWorker(); // Perform any additional setup after loading the view, typically from a nib. }
public HexoskinManager() { _watchTowerSettings = SingletonManager.WatchTowerSettings; _bgHexoskin = new BackgroundWorkerWrapper(GetData, FinishProcessingHexoskinData, _watchTowerSettings.UpdateInterval); //for (int i = 0; i < v.ConnectedAccessories.Length; i++) // Debug.WriteLine($"classic bt device name is {v.ConnectedAccessories[i].Name}"); //StartGettingData(); }
public LocationViewController(IntPtr handle) : base(handle) { Manager = SingletonManager.LocationManager; _watchTowerSettings = SingletonManager.WatchTowerSettings; }
public LocationViewController() : base("LocationViewController", null) { Manager = SingletonManager.LocationManager; _watchTowerSettings = SingletonManager.WatchTowerSettings; }