Beispiel #1
0
        protected override void OnResume()
        {
            base.OnResume();

            contentView.StartReadButton.Click += OnButtonClick;
            contentView.EndReadButton.Click   += EndRead;
            contentView.LedOnButton.Click     += delegate {
                new Thread(() => {
                    BtReceiver.LedOn();
                }).Start();
            };
            contentView.LedOffButton.Click += delegate {
                new Thread(() => {
                    BtReceiver.LedOff();
                }).Start();
            };
            contentView.ResetButton.Click += delegate {
                new Thread(() => {
                    BtReceiver.Reset();
                }).Start();
            };

            BtClient.Scanning      += OnScanning;
            BtClient.Found         += OnDeviceFound;
            BtClient.NotFound      += OnDeviceNotFound;
            BtClient.Connecting    += OnConencting;
            BtClient.Connected     += OnConnected;
            BtClient.Disconnecting += OnDisconnecting;
            BtClient.Disconnected  += OnDisconnected;

            BtClient.Init();

            contentView.Map.OnResume();
        }
Beispiel #2
0
        public void Vibrate()
        {
            Vibrator mVibrator = (Vibrator)GetSystemService(Context.VibratorService);

            // Vibrate for 300 milliseconds
            mVibrator.Vibrate(500);

            if (a == null || !a.IsShowing)
            {
                AlertDialog.Builder b = new AlertDialog.Builder(this, AlertDialog.ThemeDeviceDefaultLight);
                b.SetTitle("Fish caught!");
                b.SetNeutralButton("Nice", delegate {
                    BtReceiver.Reset();
                });

                RunOnUiThread(delegate {
                    a = b.Show();
                });
            }
        }