public MainActivity()
        {
            Log.Info("geodan main", "startup");
            BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.DefaultAdapter;

            if (mBluetoothAdapter == null)
            {
                RunOnUiThread(() =>
                {
                    showAlert("Bluetooth", "No bluetooth available");
                });
            }
            else
            {
                if (!mBluetoothAdapter.IsEnabled)
                {
                    RunOnUiThread(() =>
                    {
                        showAlert("Bluetooth", "Please activate bluetooth");
                    });
                }
            }
            beaconMgr = IBeaconManager.GetInstanceForApplication(this);

            monitorNotifier  = new MonitorNotifier();
            monitoringRegion = new Region(BEACON_ID, Settings.UUI, null, null);

            rangeNotifier = new RangeNotifier();
            rangingRegion = new Region(BEACON_ID, Settings.UUI, null, null);
        }
Esempio n. 2
0
        public NavigateToActivity()
        {
            _iBeaconManager = IBeaconManager.GetInstanceForApplication(this);

            _monitorNotifier = new MonitorNotifier();
            _rangeNotifier   = new RangeNotifier();

            _monitoringRegionsList = new List <Region>()
            {
                new Region("1", "f7826da6-4fa2-4e98-8024-bc5b71e08931", (Java.Lang.Integer) 13138, (Java.Lang.Integer) 34361),
                new Region("2", "f7826da6-4fa2-4e98-8024-bc5b71e08932", (Java.Lang.Integer) 3271, (Java.Lang.Integer) 18626),
                new Region("3", "f7826da6-4fa2-4e98-8024-bc5b71e08933", (Java.Lang.Integer) 4067, (Java.Lang.Integer) 4146),
                new Region("4", "f7826da6-4fa2-4e98-8024-bc5b71e08934", (Java.Lang.Integer) 62074, (Java.Lang.Integer) 10187),
                new Region("5", "f7826da6-4fa2-4e98-8024-bc5b71e08935", (Java.Lang.Integer) 18869, (Java.Lang.Integer) 15746),
                new Region("6", "f7826da6-4fa2-4e98-8024-bc5b71e08936", (Java.Lang.Integer) 56526, (Java.Lang.Integer) 64981),
                new Region("7", "f7826da6-4fa2-4e98-8024-bc5b71e08937", (Java.Lang.Integer) 26265, (Java.Lang.Integer) 32892),
                new Region("8", "f7826da6-4fa2-4e98-8024-bc5b71e08938", (Java.Lang.Integer) 10484, (Java.Lang.Integer) 33855),
                new Region("9", "f7826da6-4fa2-4e98-8024-bc5b71e08939", (Java.Lang.Integer) 42751, (Java.Lang.Integer) 26202),
            };

            _rangingRegionsList = new List <Region>()
            {
                new Region("1", "f7826da6-4fa2-4e98-8024-bc5b71e08931", (Java.Lang.Integer) 13138, (Java.Lang.Integer) 34361),
                new Region("2", "f7826da6-4fa2-4e98-8024-bc5b71e08932", (Java.Lang.Integer) 3271, (Java.Lang.Integer) 18626),
                new Region("3", "f7826da6-4fa2-4e98-8024-bc5b71e08933", (Java.Lang.Integer) 4067, (Java.Lang.Integer) 4146),
                new Region("4", "f7826da6-4fa2-4e98-8024-bc5b71e08934", (Java.Lang.Integer) 62074, (Java.Lang.Integer) 10187),
                new Region("5", "f7826da6-4fa2-4e98-8024-bc5b71e08935", (Java.Lang.Integer) 18869, (Java.Lang.Integer) 15746),
                new Region("6", "f7826da6-4fa2-4e98-8024-bc5b71e08936", (Java.Lang.Integer) 56526, (Java.Lang.Integer) 64981),
                new Region("7", "f7826da6-4fa2-4e98-8024-bc5b71e08937", (Java.Lang.Integer) 26265, (Java.Lang.Integer) 32892),
                new Region("8", "f7826da6-4fa2-4e98-8024-bc5b71e08938", (Java.Lang.Integer) 10484, (Java.Lang.Integer) 33855),
                new Region("9", "f7826da6-4fa2-4e98-8024-bc5b71e08939", (Java.Lang.Integer) 42751, (Java.Lang.Integer) 26202),
            };
        }
Esempio n. 3
0
 public FindR2Activity()
 {
     iBeaconManager   = IBeaconManager.GetInstanceForApplication(this);
     monitorNotifier  = new MonitorNotifier();
     rangeNotifier    = new RangeNotifier();
     monitoringRegion = new Region("r2MonitoringUniqueId", UUID, null, null);
     rangingRegion    = new Region("r2RangingUniqueId", UUID, null, null);
 }
        public MainActivity()
        {
            _iBeaconManager = IBeaconManager.GetInstanceForApplication(this);

            _monitorNotifier = new MonitorNotifier();
            _rangeNotifier   = new RangeNotifier();

            _monitoringRegion = new Region(monkeyId, UUID, null, null);
            _rangingRegion    = new Region(monkeyId, UUID, null, null);
        }
Esempio n. 5
0
        public MainActivity()
        {
            beaconMgr = IBeaconManager.GetInstanceForApplication(this);

            monitorNotifier  = new MonitorNotifier();
            monitoringRegion = new Region(BEACON_ID, UUID, null, null);

            rangeNotifier = new RangeNotifier();
            rangingRegion = new Region(BEACON_ID, UUID, null, null);
        }
Esempio n. 6
0
 public MainActivity()
 {
     beaconManager   = IBeaconManager.GetInstanceForApplication(this);
     monitorNotifier = new MonitorNotifier();
     rangeNotifier   = new RangeNotifier();
     monitorRegion   = new Region(TagName, null, null, null);
     rangeRegion     = new Region(TagName, null, null, null);
     dbm             = new DBManager();
     dbm.SetupDB();
 }
Esempio n. 7
0
        public BeaconsActivity()
        {
            _iBeaconManager = IBeaconManager.GetInstanceForApplication(this);

            _monitorNotifier      = new MonitorNotifier();
            _rangeNotifier        = new RangeNotifier();
            meterList             = new List <Meter>();
            BeaconsNearbyList     = new List <IBeacon>();
            BeaconsNearbyFlagList = new List <bool>();
            _monitoringRegion     = new Region("stat", UUID, null, null);
            _rangingRegion        = new Region("stat", UUID, null, null);
        }
        public MainActivity()
        {
            iBeaconManager = IBeaconManager.GetInstanceForApplication(this);

            monitorNotifier = new MonitorNotifier();
            rangeNotifier   = new RangeNotifier();

            //monitoringRegion = new Region(tokenId, UUID, null, null);
            //rangingRegion = new Region(tokenId, UUID, null, null);
            monitoringRegion = new Region(tokenId, null, null, null);
            rangingRegion    = new Region(tokenId, null, null, null);
        }
 /// <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;
 }
Esempio n. 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;
        }
Esempio n. 11
0
        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;
        }
Esempio n. 12
0
        public void SetBeaconsManager()
        {
            BeaconsRegionsList = new List <Region>();
            beaconMgr          = IBeaconManager.GetInstanceForApplication(this);

            if (BeaconCreds.BeaconMonitoring == BeaconMonitoring.Ranging)
            {
                foreach (Beacon beacon in Beacons.BeaconList)
                {
                    Region tempRegion = new Region(beacon.RegionId, beaconUUID, (Java.Lang.Integer)beacon.Major, (Java.Lang.Integer)beacon.Minor);
                    BeaconsRegionsList.Add(tempRegion);
                }
            }
            else
            {
                _regionForProximity  = new Region(BeaconCreds.BeaconsRegion, beaconUUID, null, null);
                BeaconsRangeNotifier = new RangeNotifier();
            }
        }
Esempio n. 13
0
        public MainActivity()
        {
            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);
            }



            _iBeaconManager = IBeaconManager.GetInstanceForApplication(this);


            _monitorNotifier = new MonitorNotifier();
            _rangeNotifier   = new RangeNotifier();

            _monitoringRegion = new Region(monkeyId, UUID2, null, null);
            _rangingRegion    = new Region(monkeyId, UUID2, null, null);

            //_monitoringRegion2 = new Region(monkeyId, UUID[2], null, null);
            //_rangingRegion2 = new Region(monkeyId, UUID[2], null, null);
        }
Esempio n. 14
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;
        }
        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;
        }
Esempio n. 16
0
 public void BindIBeaconManager(Activity mainActivity)
 {
     IBeaconManager = IBeaconManager.GetInstanceForApplication(mainActivity);
     IBeaconManager.Bind(mainActivity as IBeaconConsumer);
 }