Esempio n. 1
0
        /// <summary>
        /// Activity Life cycle method
        ///
        /// Refreshs the activity information and permissions.
        /// </summary>
        protected override void OnResume()
        {
            base.OnResume();

            if (verifyLocationPermissions())
            {
                if (!areLocationServiceDependenciesOk())
                {
                    showEnableGpsDialog();
                }
                else
                {
                    if (locationServiceController == null)
                    {
                        locationServiceController = new LocationServiceControllerDroid();
                        locationServiceController.registerAndStart();
                    }

                    if (geofencingServiceController == null)
                    {
                        geofencingServiceController = new GeofencingServiceControllerDroid();
                        geofencingServiceController.registerAndStart();
                    }
                }
            }
            else
            {
                if (locationServiceController != null && geofencingServiceController != null)
                {
                    finishGeofencingService();
                }
            }
        }
Esempio n. 2
0
 private void finishGeofencingService()
 {
     GeofencingServiceControllerDroid.stopService();
     geofencingServiceController = null;
 }