@Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Thread.setDefaultUncaughtExceptionHandler(new ExceptionHandler(this));
    setContentView(R.layout.activity_main);
    this.FindAllViewsById();
    AppGlobals.setContext(getBaseContext());
    AppGlobals.MainActivity = this;
    loginButton.setOnClickListener(
        new OnClickListener() {
          @Override
          public void onClick(View v) {
            // Alt+240 : ≡
            if (userNameEditText.getText().length() == 0
                || passwordEditText.getText().length() == 0) {
              Toast.makeText(
                      getBaseContext(),
                      "Please enter correct username or password",
                      Toast.LENGTH_LONG)
                  .show();
              return;
            }

            String query =
                userNameEditText.getText()
                    + "≡"
                    + passwordEditText.getText(); // searchEditText.getText().toString();
            performSearch(query);
          }
        });
    mBtp.setDebugService(true);
    try {
      mBtp.initService(this, mHandler);
    } catch (Exception e) {
      e.printStackTrace();
    }

    IntentFilter filter1 = new IntentFilter(BluetoothDevice.ACTION_ACL_CONNECTED);
    IntentFilter filter2 = new IntentFilter(BluetoothDevice.ACTION_ACL_DISCONNECT_REQUESTED);
    IntentFilter filter3 = new IntentFilter(BluetoothDevice.ACTION_ACL_DISCONNECTED);
    this.registerReceiver(mReceiver, filter1);
    this.registerReceiver(mReceiver, filter2);
    this.registerReceiver(mReceiver, filter3);
    AppGlobals.MacId = MacHelper.GetMacId();
    versionTextView.setText("Version: " + BuildConfig.VERSION_NAME);
  }
 @Override
 public void onActivityResult(int requestCode, int resultCode, Intent data) {
   super.onActivityResult(requestCode, resultCode, data);
   mBtp.onActivityResult(requestCode, resultCode, data, this);
 }
 @Override
 public void onResume() {
   mBtp.onActivityResume();
   DebugLog.logTrace("onResume");
   super.onResume();
 }
 @Override
 public void onDestroy() {
   mBtp.onActivityDestroy();
   super.onDestroy();
 }
 @Override
 public void onPause() {
   mBtp.onActivityPause();
   super.onPause();
 }