protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.Main); _view = FindViewById<LinearLayout>(Resource.Id.parentLayout); _text = FindViewById<TextView>(Resource.Id.logTextView); UpdateDisplay(INITIAL_MESSAGE,Color.White); var beaconManager = new BeaconManager(this); indoorLocationController = new IndoorLocationController(beaconManager); indoorLocationController.BeaconFound += HandleBeaconFound; indoorLocationController.BeaconLost += HandleBeaconLost; var beacon1 = DummyBeaconCreator.CreateBeaconUrsin(); var beacon2 = DummyBeaconCreator.CreateBeaconMarcel(); indoorLocationController.AddBeaconsAndStart(new List<Beacon>{beacon1,beacon2}); if (!IsBluetoothAvailable) { Toast.MakeText(this, "Please activate Bluetooth! iBeacons works only when Bluetooth available.",ToastLength.Long).Show(); } }
public override void ViewDidLoad() { base.ViewDidLoad(); var beaconManager = new BeaconManager(); indoorLocationController = new IndoorLocationController(beaconManager); indoorLocationController.BeaconFound += HandleBeaconFound; indoorLocationController.BeaconLost += HandleBeaconLost; indoorLocationController.DebugInfo += HandleDebugInfo; // var beacon1 = DummyBeaconCreator.CreateBeaconUrsin(); var beacon2 = DummyBeaconCreator.CreateBeaconMarcel(); indoorLocationController.AddBeaconsAndStart(new List<Beacon>(){beacon2}); }