| class info |
| com.huawei.hms.mlsdk.common.MLApplication |
| Represents an app information class used to store basic information about apps with the HMS Core ML SDK integrated. Generally, an app does not directly interact with this class. The HMS Core ML SDK initializes HUAWEI ML Kit based on the agconnect-services.json file without extra coding. |
| Type | Name | Desc |
| String | DEFAULT_APP_NAME | Default app name. |
| 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 |
Default app name. |
| Constant value: _DEFAULT |
| Method |
| public android.content.Context getAppContext() |
| Obtains the context of an app. |
Return
| Type | desc |
| android.content.Context | App context |
| Method |
| public static List<MLApplication> getAppList(android.content.Context context) |
| Obtains an app list. |
Parameters
| Parameter name | Parameter desc |
| context | App context |
Return
| Type | desc |
| List<MLApplication> | App list |
| Method |
| public String getAppName() |
| Obtains the name of an app. |
Return
| Type | desc |
| String | App name |
| Method |
| public MLApplicationSetting getAppSetting() |
| Obtains the settings of an app. |
Return
| Type | desc |
| MLApplicationSetting | App settings |
| Method |
| public static MLApplication getInstance() |
| Obtains the default app instance. |
Return
| Type | desc |
| MLApplication | Default app instance |
| Method |
| public static MLApplication getInstance(String name) |
| Obtains the app instance with the specified name. |
Parameters
| Parameter name | Parameter desc |
| name | App name |
Return
| Type | desc |
| MLApplication | App instance with the specified name. |
| Method |
| public String getUniqueKey() |
| Obtains the unique key value of the current app. |
Return
| Type | desc |
| String | Unique key value of the current app. |
| Method |
| public static String getUniqueKey(String name, MLApplicationSetting setting) |
| Obtains the unique key value of the app with the specified name and settings. |
Parameters
| Parameter name | Parameter desc |
| name | App name |
| setting | App settings |
Return
| Type | desc |
| String | Unique key value of the app with the specified name and settings. |
| Method |
| public static MLApplication initialize(android.content.Context context) |
| Initializes an app instance using the default name. |
Parameters
| Parameter name | Parameter desc |
| context | App context |
Return
| Type | desc |
| MLApplication | App instance with the default name. |
Parameters
| Parameter name | Parameter desc |
| context | App context |
| setting | Custom app settings |
Return
| Type | desc |
| MLApplication | App instance with the custom settings. |
| Method |
| public static MLApplication initialize(android.content.Context context, MLApplicationSetting setting, String name) |
| Initializes an app instance using the custom app settings and name. |
Parameters
| Parameter name | Parameter desc |
| context | App context |
| setting | Custom app settings |
| name | Custom app name |
Return
| Type | desc |
| MLApplication | App instance with the custom settings and name. |
| Method |
| public boolean isDefault() |
| Checks whether an app instance is the default one. |
Return
| Type | desc |
| boolean | true: default instance false: non-default instance |
| Method |
| public String toString() |
| Converts the current instance into a character string. |
Return
| Type | desc |
| String | Character string of the current instance. |