Contains classes for Onehop SDK
| Interface name | Interface description |
| IOneHopSdkCallback | Callback API called when an app registers HUAWEI OneHop |
| Class name | Class description |
| HwOneHopSdk | A function class used to register HUAWEI OneHop. It appears in the form of a single instance. |
| interface information |
| public interface IOneHopSdkCallback |
| The stub class of this API is used to notify the tapping event. To register OneHop with the SDK, set IOneHopSdkCallback.Stub as the callback, it is triggered by a tapping event. With this API, apps can transfer and process data based on the service requirements. |
| Return | Method |
| void | onOneHopReceived(String para)After registered by an app, this method can be invoked to transfer data after a NFC tapping event occurs. |
| Type | Name | Description |
| Class | IOneHopSdkCallback.Stub | To register OneHop with the SDK, set IOneHopSdkCallback.Stub as the callback, it is triggered by a tapping event. With this API, apps can transfer and process data based on the service requirements. |
void onOneHopReceived*(String data) After the app registers HUAWEI OneHop**, this method will be called after the NFC tapping event occurs.*
Parameters
| Parameter name | Parameter description |
| data | Service data in JSON format transmitted through HUAWEI OneHop. When a tapping event occurs, the phone transfers a parameter as follows: {“onehop_data_type”:7, “onehop _receive_type”:1, “handoff_data_type”:7}. HUAWEI OneHop will then transfer a parameter to the app on the target device. The transferred parameter is as follows:{“onehop_data_type”:7, “onehop _receive_type”:2, “handoff_data_type”:7 “xxx”:”xxx”, …} |