Ejemplo n.º 1
0
        protected override void OnCreate(Bundle bundle)
        {
            // tests can be inside the main assembly
            AddTest(Assembly.GetExecutingAssembly());
            // or in any reference assemblies
            // AddTest (typeof (Your.Library.TestClass).Assembly);

            // Once you called base.OnCreate(), you cannot add more assemblies.
            base.OnCreate(bundle);

            service = new BeaconScannerService()
            {
                ForegroundScanPeriod        = 500,
                ForegroundBetweenScanPeriod = 500,
                BackgroundScanPeriod        = 500,
                BackgroundBetweenScanPeriod = 500
            };

            BeaconScannerService.RangeNotifier.Subscribe(this);

            System.Diagnostics.Debug.WriteLine($"START SCAN: " + DateTime.Now.ToString());



            StartService(new Intent(this, service.Class));
        }
Ejemplo n.º 2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            lvBeacons = FindViewById <ListView>(Resource.Id.listView_beacons);

            service = new BeaconScannerService
            {
                ForegroundScanPeriod = 200
            };
            service.Subscribe(this);
        }