예제 #1
0
 public override StartCommandResult OnStartCommand(Intent intent, StartCommandFlags flags, int startId)
 {
     Monitor = new NetworkStatusMonitor(this);
     Monitor.NetworkStatusChanged += Monitor_NetworkStatusChanged;
     Monitor.Start();
     new Task(async() => await DoWork()).Start();
     return(StartCommandResult.Sticky);
 }
예제 #2
0
 public override StartCommandResult OnStartCommand(Intent intent, StartCommandFlags flags, int startId)
 {
     monitor = new NetworkStatusMonitor(this);
     monitor.NetworkStatusChanged += Monitor_NetworkStatusChanged;
     monitor.Start();
     elTimer           = new System.Timers.Timer(5000);
     elTimer.Elapsed  += ElTimer_Elapsed;
     elTimer.AutoReset = true;
     elTimer.Enabled   = true;
     Started           = true;
     Kill = false;
     //new Task(async () => await DoWork()).Start();
     return(StartCommandResult.Sticky);
 }
예제 #3
0
        protected override void OnResume()
        {
            base.OnResume();

            nsm   = new NetworkStatusMonitor();
            _nsbr = new NetworkStatusBroadcastReceiver();
            _nsbr.ConnectionStatusChanged += _nsbr_ConnectionStatusChanged;

            RegisterReceiver(_nsbr, new IntentFilter(ConnectivityManager.ConnectivityAction));

            //we have an image to place somewhere :D to the view provided earlier, if this isn't null
            if (!string.IsNullOrEmpty(imagePath))
            {
            }
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.SplashscreenLayout);

            //Adding preferences

            ISharedPreferences pref = Application.Context.GetSharedPreferences("FirstRun", FileCreationMode.Private);

            _isfirstrun = pref.GetBoolean("IsFirstRun", false);

            _retryButton        = (Button)FindViewById(Resource.Id.retry);
            _splashScreenParent = (RelativeLayout)FindViewById(Resource.Id.splashScreenParent);
            RegisterReceiverForToken();
            NetworkStatusMonitor.GetNetworkStatus().PassContext(this, false, true);
            App.PackageName     = ApplicationContext.PackageName;
            _retryButton.Click += (object sender, EventArgs e) =>
            {
                FetchTocken();
            };
            SetupScormEngine();
            CommonUtils.GetInstance().SetStoragePath(Utils.StoragePath());
            CheckForStoragePermision();
            App.Logger = new Logger();
            bool logStatus = DBService.GetDB().GetLogStatus();

            if (logStatus)
            {
                App.LoggerEnabled = true;
            }
            else
            {
                App.LoggerEnabled = false;
            }
            App.PublishEvent = new PublishSyncEvents(ApplicationContext);
            SetDownloadNotificationChannel();
            CheckIfPlayServiceIsAvailable();
        }