工厂类

使用 Samsung 和 Google 工厂类创建 ResellerService 对象。 对于 ResellerService 对象,系统将使用一组常见的方法 可以申领和注册三星及其他 Android 设备。

SamsungResellerServiceFactory

您必须先使用 SamsungResellerServiceFactory 类生成 ResellerService 对象,您需要使用 KDP 进行初始配置。 以下是使用ResellerService SamsungResellerServiceFactory 类:

public static ResellerService createResellerService(String resellerId, String serviceAccountKeyFilePath, String clientIdentifier) throws CommonException;

输入参数

属性名称 必填 说明
resellerId string 转销商的唯一标识符,由 KDP 系统提供。
serviceAccountKeyFilePath string 指向服务账号密钥的文件路径。
clientIdentifier string KDP 系统提供的客户端标识符。

错误行为

发生错误时,该库会抛出 CommonException 包含下列错误代码之一:

错误代码
INVALID_RESELLER_ID
AUTHORIZATION_FAIL

GoogleResellerServiceFactory

您必须先使用 GoogleResellerServiceFactory 类生成 ResellerService对象,您必须完成零触摸注册

以下是使用ResellerService GoogleResellerServiceFactory 类:

public static ResellerService createResellerService(long resellerId, String serviceAccountKeyFilePath) throws CommonException, InterruptedException;

输入参数

属性名称 必填 说明
resellerId long 转销商的唯一标识符,由零触摸系统提供。
serviceAccountKeyFilePath string 指向服务账号密钥的文件路径。

错误行为

发生错误时,该库会抛出 CommonException 包含下列错误代码之一:

错误代码
INVALID_PARAM_DEFAULT
INVALID_RESELLER_ID
INTERNAL_SERVER_ERROR