Exemple #1
0
 public void onServiceConnected(ComponentName name, IBinder service) {
   mBinder = (SPPMirrorServiceBinder) service;
   if (mBinder != null) {
     mBinder.onSync();
   } else {
     updateStatus("service connection failed");
   }
 }
Exemple #2
0
 public void onConnectLink(View view) {
   if (mBinder != null) {
     boolean auto_reconnect = mCheckBoxAutoReconnect.isChecked();
     int port = 6800;
     try {
       mLastNetPort = mEditTextNetPort.getText().toString();
       port = Integer.parseInt(mLastNetPort);
     } catch (Exception e) {
     }
     mLastBluetoothAddress = mBluetoothAddress;
     mLastAutoReconnect = mCheckBoxAutoReconnect.isChecked();
     mBinder.onConnectLink(mBluetoothAddress, port, auto_reconnect);
   }
 }
Exemple #3
0
  public void onStopService(View view) {
    if (mBinder != null) {
      mBinder.onDisconnectLink();

      try {
        updateStatus("service unbinding");
        unbindService(this);
      } catch (Exception e) {
        /* service may not be running */
      }
      updateStatus("service stopping");
      stopService(mIntent);
      mBinder = null;
      updateStatus("service stopped");
    }
  }
Exemple #4
0
 public void onDisconnectLink(View view) {
   if (mBinder != null) {
     mBinder.onDisconnectLink();
   }
 }