| class info |
| com.huawei.hms.mlsdk.common.MLApplication |
| APP信息类,用于存储集成了MLKit SDK的APP基本信息,通常情况下,应用开发者不与这个类直接交互,MLKit SDK会结合开发者申请的agconnect-services.json,完成MLKit的初始化,不需要开发者编写额外的代码。 |
| Type | Name | Desc |
| String | DEFAULT_APP_NAME | 默认的APP名称。 |
| Return type | Method name |
| android.content.Context | getAppContext() |
| List<MLApplication> | getAppList(android.content.Context context) |
| String | getAppName() |
| MLApplicationSetting | getAppSetting() |
| MLApplication | getInstance() |
| MLApplication | getInstance(String name) |
| String | getUniqueKey() |
| String | getUniqueKey(String name, MLApplicationSetting setting) |
| MLApplication | initialize(android.content.Context context) |
| MLApplication | initialize(android.content.Context context, MLApplicationSetting setting) |
| MLApplication | initialize(android.content.Context context, MLApplicationSetting setting, String name) |
| boolean | isDefault() |
| String | toString() |
| Constant |
| public static final String DEFAULT_APP_NAME |
| 默认的APP名称。 |
| Constant Value: “_DEFAULT“。 |
| Method |
| public android.content.Context getAppContext() |
| 获取APP的上下文信息。 |
Return
| Type | desc |
| android.content.Context | 返回APP上下文信息。 |
| Method |
| public static List<MLApplication> getAppList(android.content.Context context) |
| 获取应用列表。 |
Parameters
| Parameter name | Parameter desc |
| context | 上下文信息。 |
Return
| Type | desc |
| List<MLApplication> | 返回应用列表。 |
| Method |
| public String getAppName() |
| 获取应用名称。 |
Return
| Type | desc |
| String | 返回应用名称。 |
| Method |
| public MLApplicationSetting getAppSetting() |
| 获取应用配置信息。 |
Return
| Type | desc |
| MLApplicationSetting | 返回应用配置信息。 |
| Method |
| public static MLApplication getInstance() |
| 获取默认的APP实例。 |
Return
| Type | desc |
| MLApplication | 返回默认的APP实例。 |
| Method |
| public static MLApplication getInstance(String name) |
| 根据名称获取APP实例。 |
Parameters
| Parameter name | Parameter desc |
| name | APP名称 |
Return
| Type | desc |
| MLApplication | 返回指定名称的APP实例。 |
| Method |
| public String getUniqueKey() |
| 获取当前应用名称和配置项对应的唯一键值。 |
Return
| Type | desc |
| String | 当前应用的唯一键值。 |
| Method |
| public static String getUniqueKey(String name, MLApplicationSetting setting) |
| 获取指定应用名称和配置项对应的唯一键值。 |
Parameters
| Parameter name | Parameter desc |
| name | 应用名称 |
| setting | 应用配置项。 |
Return
| Type | desc |
| String | 指定应用名称和配置项对应的唯一键值。 |
| Method |
| public static MLApplication initialize(android.content.Context context) |
| 以默认名称初始化App实例。 |
Parameters
| Parameter name | Parameter desc |
| context | 应用的上下文信息。 |
Return
| Type | desc |
| MLApplication | 返回默认名称的App实例。 |
| Method |
| public static MLApplication initialize(android.content.Context context, MLApplicationSetting setting) |
| 以自定义的APP配置信息(包括包名、APIKEY等信息)初始化HmsMLApp实例。 |
Parameters
| Parameter name | Parameter desc |
| context | 应用的上下文信息。 |
| setting | 自定义APP配置信息。 |
Return
| Type | desc |
| MLApplication | 返回自定义配置的App实例。 |
| Method |
| public static MLApplication initialize(android.content.Context context, MLApplicationSetting setting, String name) |
| 以自定义的APP配置信息以及自定义名称初始化App实例。 |
Parameters
| Parameter name | Parameter desc |
| context | 应用的上下文信息。 |
| setting | 自定义APP配置信息。 |
| name | 自定义APP名称。 |
Return
| Type | desc |
| MLApplication | 返回自定义的App实例。 |
| Method |
| public boolean isDefault() |
| 判断是否是默认APP实例。 |
Return
| Type | desc |
| boolean | 返回 true:是 false:不是 |
| Method |
| public String toString() |
| 当前实例转换为字符串。 |
Return
| Type | desc |
| String | 当前实例的字符串。 |