protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Main);
            textUUID       = FindViewById <TextView>(Resource.Id.textUUID);
            textProximity  = FindViewById <TextView>(Resource.Id.textProximity);
            textDistance   = FindViewById <TextView>(Resource.Id.textDistance);
            textMajor      = FindViewById <TextView>(Resource.Id.textMajor);
            textMinor      = FindViewById <TextView>(Resource.Id.textMinor);
            textMessage    = FindViewById <TextView>(Resource.Id.textMessage);
            textNumberSeen = FindViewById <TextView>(Resource.Id.textNumberSeen);
            textStatus     = FindViewById <TextView>(Resource.Id.textStatus);
            textInRange    = FindViewById <TextView>(Resource.Id.textInRange);

            textUUID.Text = textProximity.Text = textMajor.Text = textMinor.Text = textMessage.Text = "";

            var btAdapter = BluetoothAdapter.DefaultAdapter;

            if (btAdapter.IsEnabled)
            {
                textStatus.SetTextColor(Android.Graphics.Color.AliceBlue);
                textStatus.Text = "Searching";
            }
            else
            {
                textStatus.SetTextColor(Android.Graphics.Color.Red);
                textStatus.Text = "Bluetooth not enabled";
            }

            beaconManager.Bind(this);

            monitorNotifier.EnterRegionComplete           += EnterRegion;
            monitorNotifier.ExitRegionComplete            += ExitRegion;
            rangeNotifier.DidRangeBeaconsInRegionComplete += RangingBeaconsInRegion;
        }
        public BeaconManager(Activity activity)
        {
            beaconsToStart = new List<Beacon>();

            this.activity = activity;

            beaconManager = IBeaconManager.GetInstanceForApplication(activity);
            beaconManager.Bind(this);
        }
Exemple #3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            _iBeaconManager.Bind(this);

            _monitorNotifier.EnterRegionComplete += EnteredRegion;
            _monitorNotifier.ExitRegionComplete  += ExitedRegion;

            _rangeNotifier.DidRangeBeaconsInRegionComplete += RangingBeaconsInRegion;

            _destination = Intent.GetStringExtra("destination");
        }
Exemple #4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            Forms.Init(this, savedInstanceState);
            CarouselViewRenderer.Init();
            beaconMgr.Bind(this);
            SetSensorManager();
            Android.Graphics.Color barColor = Android.Graphics.Color.ParseColor("#191A2F");
            Window.SetStatusBarColor(barColor);
            LoadApplication(new App());
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ARArt.Android.BeaconLocaterAndroid"/> class.
 /// </summary>
 public BeaconLocaterAndroid()
 {
     beacons          = new List <BeaconItem>();
     context          = Xamarin.Forms.Forms.Context;
     iBeaconManager   = IBeaconManager.GetInstanceForApplication(context);
     monitorNotifier  = new MonitorNotifier();
     rangeNotifier    = new RangeNotifier();
     monitoringRegion = new Region(beaconId, uuid, null, null);
     rangingRegion    = new Region(beaconId, uuid, null, null);
     iBeaconManager.Bind(this);
     rangeNotifier.DidRangeBeaconsInRegionComplete += RangingBeaconsInRegion;
 }
Exemple #6
0
        public void Bind(IBeaconConsumer ibeaconconsumer)
        {
            beaconMgr = IBeaconManager.GetInstanceForApplication((Context)ibeaconconsumer);
            beaconMgr.Bind(ibeaconconsumer);

            monitorNotifier = new MonitorNotifier();
            monitorNotifier.EnterRegionComplete += EnteredRegionHandler;
            monitorNotifier.ExitRegionComplete += ExitedRegionHandler;

            rangeNotifier = new RangeNotifier();
            rangeNotifier.DidRangeBeaconsInRegionComplete += EnteredRangeHandler;
        }
Exemple #7
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.Dashboard);

            dashboard         = FindViewById <LinearLayout>(Resource.Id.dashboardLayout);
            trackButton       = FindViewById <Button>(Resource.Id.track);
            trackingTextView  = FindViewById <TextView>(Resource.Id.tracking_text);
            progressImageView = FindViewById <ImageView>(Resource.Id.progressImage);

            trackButton.Enabled = false;

            iBeaconManager.Bind(this);
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.Main);

            beaconStatusLabel = FindViewById <TextView> (Resource.Id.beaconStatusLabel);

            beaconMgr.Bind(this);

            monitorNotifier.EnterRegionComplete += EnteredRegion;
            monitorNotifier.ExitRegionComplete  += ExitedRegion;

            rangeNotifier.DidRangeBeaconsInRegionComplete += RangingBeaconsInRegion;
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.Main);

            _view = FindViewById <RelativeLayout>(Resource.Id.findTheMonkeyView);
            _text = FindViewById <TextView>(Resource.Id.monkeyStatusLabel);

            _iBeaconManager.Bind(this);

            _monitorNotifier.EnterRegionComplete += EnteredRegion;
            _monitorNotifier.ExitRegionComplete  += ExitedRegion;

            _rangeNotifier.DidRangeBeaconsInRegionComplete += RangingBeaconsInRegion;
        }
Exemple #10
0
        public override void OnCreate()
        {
            base.OnCreate ();

            _iBeaconManager = IBeaconManager.GetInstanceForApplication (this);

            _iBeaconManager.SetForegroundScanPeriod (2000);
            _iBeaconManager.SetForegroundBetweenScanPeriod (2500);

            _rangeNotifier = new RangeNotifier ();

            _rangingRegion = new Region (monkeyId, UUID, null, null);
            _iBeaconManager.Bind (this);

            _rangeNotifier.DidRangeBeaconsInRegionComplete += RangingBeaconsInRegion;
        }
        public BeaconLocater()
        {
            beacons = new List <BeaconItem>();
            context = Plugin.CurrentActivity.CrossCurrentActivity.Current.Activity;

            iBeaconManager  = IBeaconManager.GetInstanceForApplication(context);
            monitorNotifier = new MonitorNotifier();
            rangeNotifier   = new RangeNotifier();
            //DMI beacon UUId - b9407f30-f5f8-466e-aff9-25556b57fe6d
            monitoringRegion = new Region("ID", "6A1A7B3B-2B8C-6A4C-9A7C-0D1403107060", null, null);
            rangingRegion    = new Region("ID", "6A1A7B3B-2B8C-6A4C-9A7C-0D1403107060", null, null);

            iBeaconManager.Bind(this);

            rangeNotifier.DidRangeBeaconsInRegionComplete += RangingBeaconsInRegion;
        }
Exemple #12
0
        public override void OnCreate()
        {
            base.OnCreate();

            _iBeaconManager = IBeaconManager.GetInstanceForApplication(this);

            _iBeaconManager.SetForegroundScanPeriod(2000);
            _iBeaconManager.SetForegroundBetweenScanPeriod(2500);

            _rangeNotifier = new RangeNotifier();

            _rangingRegion = new Region(monkeyId, UUID, null, null);
            _iBeaconManager.Bind(this);

            _rangeNotifier.DidRangeBeaconsInRegionComplete += RangingBeaconsInRegion;
        }
Exemple #13
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            Forms.Init(this, bundle);

            _mainPage = (MainPage)App.GetMainPage();

            SetPage(_mainPage);

            beaconMgr.Bind(this);

            monitorNotifier.EnterRegionComplete += EnteredRegion;
            monitorNotifier.ExitRegionComplete  += ExitedRegion;

            rangeNotifier.DidRangeBeaconsInRegionComplete += RangingBeaconsInRegion;
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.Main);

            view            = FindViewById <RelativeLayout>(Resource.Id.findTheTokenView);
            textViewMessage = FindViewById <TextView>(Resource.Id.tokenStatusLabel);

            iBeaconManager.Bind(this);

            monitorNotifier.EnterRegionComplete += EnteredRegion;
            monitorNotifier.ExitRegionComplete  += ExitedRegion;

            rangeNotifier.DidRangeBeaconsInRegionComplete += RangingBeaconsInRegion;

            SwitchOnBT();
        }
Exemple #15
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;
            AndroidEnvironment.UnhandledExceptionRaiser += HandleAndroidException;
            base.OnCreate(savedInstanceState);
            Plugin.CurrentActivity.CrossCurrentActivity.Current.Init(this, savedInstanceState);
            RequestPermissions(PermissionsLocation, RequestLocationId);

            _iBeaconManager.Bind(this);

            _monitorNotifier.EnterRegionComplete += EnteredRegion;
            _monitorNotifier.ExitRegionComplete  += ExitedRegion;

            _rangeNotifier.DidRangeBeaconsInRegionComplete += RangingBeaconsInRegion;
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
            LoadApplication(new App());
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            temp.Add("R1");
            temp.Add("R2");
            temp.Add("R3");
            temp.Add("R4");
            temp.Add("R5");
            temp.Add("R6");
            temp.Add("R7");
            temp.Add("R8");
            temp.Add("R9");
            temp.Add("R10");

            for (int k = 0; k < numberBLE; k++)
            {
                beaconActive.Add("0");
            }

            for (int k = 0; k < numberBLE; k++)
            {
                beaconTime.Add(0);
            }

            for (int k = 0; k < numberBLE; k++)
            {
                beaconDist.Add(0.0);
            }

            SetContentView(Resource.Layout.Main);

            _view = FindViewById <RelativeLayout>(Resource.Id.findTheMonkeyView);
            _text = FindViewById <TextView>(Resource.Id.monkeyStatusLabel);

            _iBeaconManager.Bind(this);

            _monitorNotifier.EnterRegionComplete += EnteredRegion;
            _monitorNotifier.ExitRegionComplete  += ExitedRegion;

            _rangeNotifier.DidRangeBeaconsInRegionComplete += RangingBeaconsInRegion;
        }
Exemple #17
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.Main);

            _view = FindViewById <RelativeLayout>(Resource.Id.findTheMonkeyView);
            _text = FindViewById <TextView>(Resource.Id.monkeyStatusLabel);

            //////
            _iBeaconManager = IBeaconManager.GetInstanceForApplication(this);

            _iBeaconManager.SetForegroundScanPeriod(2000);
            _iBeaconManager.SetForegroundBetweenScanPeriod(2500);

            _rangeNotifier = new RangeNotifier();

            _rangingRegion = new Region(monkeyId, UUID, null, null);
            _iBeaconManager.Bind(this);

            _rangeNotifier.DidRangeBeaconsInRegionComplete += RangingBeaconsInRegion;
        }
        protected override void OnCreate(Bundle bundle)
        {
            Log.Info("geodan main", "OnCreate");

            base.OnCreate(bundle);

            SetContentView(Resource.Layout.Main);

            beaconStatusLabel      = FindViewById <TextView>(Resource.Id.beaconStatusLabel);
            beaconStatusUpdateTime = FindViewById <TextView>(Resource.Id.beaconStatusUpdateTime);
            var editTextName = FindViewById <TextView>(Resource.Id.editText1);

            var prefs1         = Application.Context.GetSharedPreferences("MyApp1", FileCreationMode.Private);
            var usernameStored = prefs1.GetString("username", null);

            if (!String.IsNullOrEmpty(usernameStored))
            {
                editTextName.Text = usernameStored;
            }

            beaconMgr.Bind(this);

            monitorNotifier.EnterRegionComplete           += EnteredRegion;
            monitorNotifier.ExitRegionComplete            += ExitedRegion;
            rangeNotifier.DidRangeBeaconsInRegionComplete += RangingBeaconsInRegion;

            var button = FindViewById <Button>(Resource.Id.button1);

            button.Click += delegate
            {
                Settings.name = editTextName.Text;
                var prefs      = Application.Context.GetSharedPreferences("MyApp1", FileCreationMode.Private);
                var prefEditor = prefs.Edit();
                prefEditor.PutString("username", Settings.name);
                prefEditor.Commit();

                editTextName.ClearFocus();
            };
        }
Exemple #19
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            // SetContentView(Resource.Layout.Main);

            SetContentView(Resource.Layout.layout1);
            listView = FindViewById <ListView>(Resource.Id.List); // get reference to the ListView in the layout
                                                                  // populate the listview with data

            itemsAdapter        = new MetersAdapter(this, meterList);
            listView.Adapter    = itemsAdapter;
            listView.ItemClick += OnListItemClick;  // to be defined

            _iBeaconManager.Bind(this);

            _monitorNotifier.EnterRegionComplete += EnteredRegion;
            _monitorNotifier.ExitRegionComplete  += ExitedRegion;

            _rangeNotifier.DidRangeBeaconsInRegionComplete += RangingBeaconsInRegion;
            ShowNotification();
        }
        public BeaconLocaterAndroid()
        {
            beacons = new List<BeaconItem> ();

            //for testing
            //			beacons = new List<BeaconItem> {
            //				new BeaconItem { Name = "Android1", Minor = "1233", CurrentDistance = 0.5 },
            //				new BeaconItem { Name = "Android2", Minor = "1234", CurrentDistance = 0.2 },
            //				new BeaconItem { Name = "Android3", Minor = "1235", CurrentDistance = 12.5 },
            //			};

            context = Android.App.Application.Context;

            _iBeaconManager = IBeaconManager.GetInstanceForApplication (context);
            _monitorNotifier = new MonitorNotifier ();
            _rangeNotifier = new RangeNotifier ();

            _monitoringRegion = new Region (beaconId, uuid, null, null);
            _rangingRegion = new Region(beaconId, uuid, null, null);

            _iBeaconManager.Bind (this);

            _rangeNotifier.DidRangeBeaconsInRegionComplete += RangingBeaconsInRegion;
        }
        public BeaconLocaterAndroid()
        {
            beacons = new List <BeaconItem> ();

            //for testing
//			beacons = new List<BeaconItem> {
//				new BeaconItem { Name = "Android1", Minor = "1233", CurrentDistance = 0.5 },
//				new BeaconItem { Name = "Android2", Minor = "1234", CurrentDistance = 0.2 },
//				new BeaconItem { Name = "Android3", Minor = "1235", CurrentDistance = 12.5 },
//			};

            context = Application.Context;

            _iBeaconManager  = IBeaconManager.GetInstanceForApplication(context);
            _monitorNotifier = new MonitorNotifier();
            _rangeNotifier   = new RangeNotifier();

            _monitoringRegion = new Region(beaconId, uuid, null, null);
            _rangingRegion    = new Region(beaconId, uuid, null, null);

            _iBeaconManager.Bind(this);

            _rangeNotifier.DidRangeBeaconsInRegionComplete += RangingBeaconsInRegion;
        }
Exemple #22
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            iBeaconManager.Bind(this);
        }
 public void BindIBeaconManager(Activity mainActivity)
 {
     IBeaconManager = IBeaconManager.GetInstanceForApplication(mainActivity);
     IBeaconManager.Bind(mainActivity as IBeaconConsumer);
 }