Last Updated on : 2024-05-27 06:34:32download
This pairing mode only applies to devices that have been connected to the internet.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
mode |
ActivatorMode |
Yes | The pairing mode. |
Example
QRScanActivator qrScanActivator = (QRScanActivator) ActivatorService.activator(ActivatorMode.QRScan);
Example: depends on implementation 'com.journeyapps:zxing-android-embedded:3.6.0'
Example
IntentIntegrator integrator = new IntentIntegrator(activity);
integrator.initiateScan();
Example
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
if (result != null && result.getContents() != null) {
String code = result.getContents();
}
}
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
assetId | String | Yes | The ID of the specified asset or space. |
code | String | Yes | The code extracted from the QR code. |
QRScanActivatorParams qrScanActivatorParams = new QRScanActivatorParams.Builder()
.setAssetId("assetId")
.setCode("code")
.build();
qrScanActivator.setParams(qrScanActivatorParams);
IActivatorListener
to listen for pairing resultParameters
Parameter | Type | Required | Description |
---|---|---|---|
listener | IActivatorListener | Yes | The device information returned by the callback. |
Example
qrScanActivator.setListener(new IActivatorListener() {
@Override
public void onSuccess(@Nullable IDevice iDevice) {
Log.d(TAG, "onSuccess: ");
}
@Override
public void onError(@NonNull String s, @NonNull String s1) {
Log.d(TAG, "onError: ");
}
});
This method starts device pairing.
Example
qrScanActivator.start();
This method stops device pairing.
Example
qrScanActivator.stop();
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback