Example #1
0
 @Override
 public void onServiceConnected(ComponentName name, IBinder service) {
   mAccessoryService = ((AccessoryService.MyBinder) service).getService();
   mAccessoryService.registerAction(getAction());
   isBound = true;
   Toast.makeText(getApplicationContext(), "onSERVICECONNECTED", Toast.LENGTH_SHORT).show();
 }
Example #2
0
  /**
   * AccessoryService으로 알람시간간격 전달
   *
   * @param mData
   */
  private void sendDataToService(String mData) {

    if (isBound && mAccessoryService != null) {
      mAccessoryService.sendData(mData);
    } else {
      Toast.makeText(getApplicationContext(), "기어와 연결을 확인하세요", Toast.LENGTH_SHORT).show();
    }
  }
Example #3
0
 private void startConnection() {
   if (isBound && mAccessoryService != null) {
     mAccessoryService.findPeers();
   }
 }