Unbinding a Device

API Function

This API is used to register the broadcast for receiving the command used to unbind a directly connected device from the IoT platform. After this broadcast is received, you must delete the configuration information about the directly connected device and release all resources. When the device restarts, bind the device to the IoT platform again.

API Description

1
HubService.TOPIC_UNBINDDEVICE;

Class

HubService

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
BroadcastReceiver mUnbindRsp; 
mUnbindRsp = new BroadcastReceiver() { 
    @Override 
    public void onReceive(Context context, Intent intent) { 
        //Delete config file, free resource 
        return; 
    } 
}; 
mLocalBroadcastManager = LocalBroadcastManager.getInstance(this); 
IntentFilter filterUnbind = new IntentFilter(HubService.TOPIC_UNBINDDEVICE); 
mLocalBroadcastManager.registerReceiver(mUnbindRsp, filterUnbind);