com.google.android.gms.wearable.ChannelApi Java Examples

The following examples show how to use com.google.android.gms.wearable.ChannelApi. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ListenerService.java    From xDrip with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onDestroy() {
    super.onDestroy();
    if (googleApiClient != null && googleApiClient.isConnected()) {
        googleApiClient.disconnect();
    }
    if (googleApiClient != null) {
        Wearable.MessageApi.removeListener(googleApiClient, this);
        Wearable.ChannelApi.removeListener(googleApiClient, this);
    }

    Log.d(TAG, "Stop Sensors");
    stopMeasurement();


    if (mPrefs.getBoolean("enable_wearG5", true)) {
        Log.d(TAG, "Start BT Collection Service");
        stopBtService();
    }
}
 
Example #2
Source File: ListenerService.java    From xDrip-plus with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onDestroy() {
    super.onDestroy();
    if (googleApiClient != null && googleApiClient.isConnected()) {
        googleApiClient.disconnect();
    }
    if (googleApiClient != null) {
        Wearable.MessageApi.removeListener(googleApiClient, this);
        Wearable.ChannelApi.removeListener(googleApiClient, this);
    }

    Log.d(TAG, "Stop Sensors");
    stopMeasurement();


    if (mPrefs.getBoolean("enable_wearG5", true)) {
        Log.d(TAG, "Start BT Collection Service");
        stopBtService();
    }
}
 
Example #3
Source File: ListenerService.java    From AndroidAPS with GNU Affero General Public License v3.0 6 votes vote down vote up
@Override
public void onConnected(Bundle bundle) {
    // Log.d(TAG, logPrefix + "onConnected call requestData");

    CapabilityApi.CapabilityListener capabilityListener = new CapabilityApi.CapabilityListener() {

        @Override
        public void onCapabilityChanged(CapabilityInfo capabilityInfo) {
            updatePhoneSyncBgsCapability(capabilityInfo);
            Log.d(TAG, logPrefix + "onConnected onCapabilityChanged mPhoneNodeID:" + mPhoneNodeId
                + ", Capability: " + capabilityInfo);
        }
    };

    Wearable.CapabilityApi.addCapabilityListener(googleApiClient, capabilityListener, CAPABILITY_PHONE_APP);

    Wearable.ChannelApi.addListener(googleApiClient, this);
    requestData();
}
 
Example #4
Source File: ListenerService.java    From xDrip with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onConnected(Bundle bundle) {
    Log.d(TAG, "onConnected call requestData");

    Wearable.ChannelApi.addListener(googleApiClient, this);
    requestData();
}
 
Example #5
Source File: ListenerService.java    From xDrip-plus with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onConnected(Bundle bundle) {
    Log.d(TAG, "onConnected call requestData");

    Wearable.ChannelApi.addListener(googleApiClient, this);
    requestData();
}
 
Example #6
Source File: ListenerService.java    From AndroidAPS with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
  public void onDestroy() {
      super.onDestroy();
      if (googleApiClient != null && googleApiClient.isConnected()) {
          googleApiClient.disconnect();
      }

      if (googleApiClient != null) {
          Wearable.MessageApi.removeListener(googleApiClient, this);
          Wearable.ChannelApi.removeListener(googleApiClient, this);
      }
}
 
Example #7
Source File: ChannelImpl.java    From android_external_GmsLib with Apache License 2.0 4 votes vote down vote up
@Override
public PendingResult<Status> addListener(GoogleApiClient client, ChannelApi.ChannelListener listener) {
    Log.d(TAG, "unimplemented Method: addListener");
    return null;
}
 
Example #8
Source File: ChannelImpl.java    From android_external_GmsLib with Apache License 2.0 4 votes vote down vote up
@Override
public PendingResult<Status> removeListener(GoogleApiClient client, ChannelApi.ChannelListener listener) {
    Log.d(TAG, "unimplemented Method: removeListener");
    return null;
}