public static void SetWakeUpAlarmRepeating(Context context, long firstFireAfterMIliseconds)
        {
            WakeUpAlarmReceiver.CancelWakeUpAlarmRepeating(context);
            AlarmManager am     = (AlarmManager)context.GetSystemService(Context.AlarmService);
            Intent       intent = new Intent(context, typeof(WakeUpAlarmReceiver));

            pendingIntent = PendingIntent.GetBroadcast(context, 0, intent, 0);
            am.SetInexactRepeating(AlarmType.ElapsedRealtimeWakeup, SystemClock.ElapsedRealtime() + firstFireAfterMIliseconds, AlarmManager.IntervalHour, pendingIntent);
        }
        public override void OnReceive(Context context, Intent intent)
        {
            ConnectivityManager cm            = (ConnectivityManager)context.GetSystemService(Context.ConnectivityService);
            NetworkInfo         activeNetwork = cm.ActiveNetworkInfo;
            var isConnected = activeNetwork != null && activeNetwork.IsConnected;

            if (!isConnected)
            {
                WakeUpAlarmReceiver.CancelWakeUpAlarmRepeating(context);
            }
            else
            {
                //first fire after 5 sec
                WakeUpAlarmReceiver.SetWakeUpAlarmRepeating(context, 1000 * 10);
            }
        }