public void scheduleRepeated()
        {
            TimeSpan WIFI_PERIOD = (FilteringObjects.isFiltering && FilteringObjects.isInWifiBlockZone) ?
                                   WIFI_PERIOD_BLOCKED : WIFI_PERIOD_ALLOWED;

            int taskID = AndroidBridge.scheduleJob(WIFI_PERIOD, WIFI_PERIOD + TimeSpan.FromSeconds(10), null,
                                                   (finishFunc) => {
                if (AndroidBridge.isForegroundServiceUp())
                {
                    AndroidBridge.StartWifiScanning();
                    scheduleRepeated();
                }
                finishFunc(false);
            },
                                                   () => AndroidBridge.isForegroundServiceUp(),
                                                   null,
                                                   () => false
                                                   );

            if (taskID < 0)
            {
                AndroidBridge.e(TAG, "Failed to schedule job.");
            }
        }