コード例 #1
0
        public override bool OnStartJob(JobParameters args)
        {
            _ = Task.Run(async() =>
            {
                Log.Debug("LOCTEST", "LOCTEST - OnStartJob - 1");

                var folder = Android.OS.Environment.ExternalStorageDirectory.ToString();
                var ts     = new TrackerService(folder);
                await ts.TrackAsync("LS");

                Log.Debug("LOCTEST", "LOCTEST - OnStartJob - 2");

                JobFinished(args, false);
            });

            return(true);
        }
コード例 #2
0
        public override Result DoWork()
        {
            try
            {
                Log.Info("LOCTEST", "LOCTEST - DoWork");

                Task.Run(async() =>
                {
                    var folder = Android.OS.Environment.ExternalStorageDirectory.ToString();
                    var ts     = new TrackerService(folder);
                    await ts.TrackAsync("LW");
                })
                .Wait();

                return(Result.InvokeSuccess());
            }
            catch (Exception ex)
            {
                Log.Error("LOCTEST", $"LOCTEST - {ex.Message}");
                return(Result.InvokeRetry());
            }
        }