示例#1
0
        public AddUpdateLocationForm(Location location, LocationGetter locationGetter, LocationAdder locationAdder)
        {
            InitializeComponent();
            _location        = location;
            _locationGetter  = locationGetter;
            _locationAdder   = locationAdder;
            _locationUpdater = new LocationUpdater();
            locationBindingSource.DataSource = _location;

            if (_location.IsNew)
            {
                Text = "Add Location";
            }
            else
            {
                Text = _location.Description;
            }
        }
示例#2
0
        // ILocationListener is a way for the Service to subscribe for updates
        // from the System location Service

        public void OnLocationChanged(Android.Locations.Location location)
        {
            this.LocationChanged(this, new LocationChangedEventArgs(location));

            // This should be updating every time we request new location updates
            // both when teh app is in the background, and in the foreground
            Log.Debug(logTag, String.Format("Latitude is {0}", location.Latitude));
            Log.Debug(logTag, String.Format("Longitude is {0}", location.Longitude));
            Log.Debug(logTag, String.Format("Altitude is {0}", location.Altitude));
            Log.Debug(logTag, String.Format("Speed is {0}", location.Speed));
            Log.Debug(logTag, String.Format("Accuracy is {0}", location.Accuracy));
            Log.Debug(logTag, String.Format("Bearing is {0}", location.Bearing));

            Task.Run(() =>
            {
                LocationUpdater.UpdateLocation(App.UserDetails.Name, App.UserDetails.Phone, App.UserDetails.BloodGroup,
                                               App.UserDetails.Hierarchy, App.UserDetails.Reserve, location.Latitude, location.Longitude);
            });
        }
示例#3
0
 // Use this for initialization
 void Start()
 {
     LocationUpdater_ = gameObject.GetComponent <LocationUpdater>();
 }