Class Info |
|---|
com.huawei.hms.analytics.HiAnalytics Provides methods to obtain Analytics Kit instances. |
Qualifier and Type | Method Name and Description |
|---|---|
static HiAnalyticsInstance | getInstance(Activity activity) Obtains an Analytics Kit instance. |
static HiAnalyticsInstance | getInstance(Context context) Obtains an Analytics Kit instance. |
static HiAnalyticsInstance | getInstance(Context context, String routePolicy) Obtains an Analytics Kit instance. To call this method, you must set a data processing location. |
Method |
|---|
public static HiAnalyticsInstance getInstance(Activity activity) Obtains an Analytics Kit instance. Analytics Kit will be initialized in the main thread based on your configuration. NOTE:
|
Parameters
Name | Description |
|---|---|
activity | Activity instance. |
Returns
Type | Description |
|---|---|
Analytics Kit instance. |
Method |
|---|
public static HiAnalyticsInstance getInstance(Context context) Obtains an Analytics Kit instance. Analytics Kit will be initialized in the main thread based on your configuration. If the initialization is performed in Context mode, automatic collection of the LAUNCHAPP event is affected, and in some scenarios, the app launch mode cannot be obtained. NOTE:
|
Parameters
Name | Description |
|---|---|
context | Context instance. |
Returns
Type | Description |
|---|---|
Analytics Kit instance. |
Method |
|---|
public static HiAnalyticsInstance getInstance(Context context, String routePolicy) Obtains an Analytics Kit instance. Analytics Kit will be initialized in the main thread based on your configuration. If the initialization is performed in Context mode, automatic collection of the LAUNCHAPP event is affected, and in some scenarios, the app launch mode cannot be obtained. In this case, an Activity instance needs to be passed for initializing Analytics Kit. NOTE:
|
Parameters
Name | Description |
|---|---|
context | Context instance. |
routePolicy | Data processing location. The options are CN (China), DE (Germany), SG (Singapore), and RU (Russia). NOTE: The data processing location you set must have the data storage permission. Otherwise, data cannot be reported to it. |
Returns
Type | Description |
|---|---|
Analytics Kit instance. |