目录

Contains classes for Onehop SDK

Interfaces

Interface nameInterface description
IOneHopSdkCallbackCallback API called when an app registers HUAWEI OneHop

Classes

Class nameClass description
HwOneHopSdkA 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.

Public Method Summary

ReturnMethod
voidonOneHopReceived(String para)After registered by an app, this method can be invoked to transfer data after a NFC tapping event occurs.

Nested Class Summary

TypeNameDescription
ClassIOneHopSdkCallback.StubTo 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.

Public Methods

void onOneHopReceived*(String data) After the app registers HUAWEI OneHop**, this method will be called after the NFC tapping event occurs.*
Parameters

Parameter nameParameter description
dataService 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”, …}