public void tryConnect(){
  try {
    if (TextUtils.isEmpty(AppInfo.btAddress)) {
      return;
    }
    if (null == mAdapter) {
      mAdapter=BluetoothAdapter.getDefaultAdapter();
    }
    if (null == mAdapter) {
      return;
    }
    if (null == mBtService) {
      mBtService=new BtService(mContext);
    }
    if (mBtService.getState() != BtService.STATE_CONNECTED) {
      if (!TextUtils.isEmpty(AppInfo.btAddress)) {
        BluetoothDevice device=mAdapter.getRemoteDevice(AppInfo.btAddress);
        mBtService.connect(device);
        return;
      }
    }
 else {
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
catch (  Error e) {
    e.printStackTrace();
  }
}

public void tryConnect ( ) { try { if ( TextUtils . isEmpty ( AppInfo . btAddress ) ) { return ; } if ( null == mAdapter ) { mAdapter = BluetoothAdapter . getDefaultAdapter ( ) ; } if ( null == mAdapter ) { return ; } if ( null == mBtService ) { mBtService = new BtService ( mContext ) ; } if ( mBtService . getState ( ) != BtService . STATE_CONNECTED ) { if ( ! TextUtils . isEmpty ( AppInfo . btAddress ) ) { BluetoothDevice device = mAdapter . getRemoteDevice ( AppInfo . btAddress ) ; mBtService . connect ( device ) ; return ; } } else { } } catch ( Exception e ) { e . printStackTrace ( ) ; } catch ( Error e ) { e . printStackTrace ( ) ; } }
when bluetooth status is changed , if the printer is in use , connect it , else do nothing
